metalink上的文章较全的,中文的可参考我的博客EBS开发技术之trace http://blog.csdn.net/cai_xingyun/article/details/17250971
This document provides instructions on how to create and retrieve Forms and Database level SQL trace. The example details below are for receiving processes, but these instructions are also applicable for other forms and concurrent processes.
Please reference Note 299497.1 for instructions on how to gather debug information for receiving processes.
Forms level trace is SQL trace generated before the transaction is saved on a form. It is enabled from the form and captures SQL code related to the execution of the form. This should be used when the error occurs on the form BEFORE clicking on the save. Typically these are FRM or APP errors but there could be other varying error messages.
Steps to generate forms level trace:
Database level trace is SQL trace generated after the transaction is saved and receiving transaction processor is processing the transaction. This should be generated when the error occurs AFTER clicking Save to commit the transaction on a receiving form. In Online receiving mode typically "rvtptcontrol failed" error occurs. For Immediate or Batch receiving modes the error(s) is recorded in the receiving transaction processor concurrent request log file. There are many ways to gather a database trace file for receiving processes.
Setting this profile to ‘Yes’ will generate a Event 10046 Level 12 database level trace for the receiving transaction being saved.
Steps to generate trace file:
Location of the trace file:
select value from V$PARAMETER where name like 'user%';
This can be used only when saving the transaction in Immediate or Batch mode. This method generates an Event 10046 Level 1 trace only with no bind variables and no waits.
Steps to generate trace file:
Location of the trace file:
The trace file can be located using the SQL below. Use the concurrent request id noted in step 3.
SQL> prompt undefine request_id accept request_id prompt 'Please enter the concurrent request id of Receiving Transaction Processor:' prompt column traceid format a8 column tracename format a80 column user_concurrent_program_name format a40 column execname format a15 column enable_trace format a12 set lines 80 set pages 22 set head off SELECT 'Request id: '||request_id , 'Trace id: '||oracle_Process_id, 'Trace Flag: '||req.enable_trace, 'Trace Name: '||dest.value||'/'||lower(dbnm.value)||'_ora_'||oracle_process_id||'.trc', 'Prog. Name: '||prog.user_concurrent_program_name, 'File Name: '||execname.execution_file_name|| execname.subroutine_name , 'Status : '||decode(phase_code,'R','Running') ||'-'||decode(status_code,'R','Normal'), 'SID Serial: '||ses.sid||','|| ses.serial#, 'Module : '||ses.module from fnd_concurrent_requests req, v$session ses, v$process proc, v$parameter dest, v$parameter dbnm, fnd_concurrent_programs_vl prog, fnd_executables execname where req.request_id = &request_id and req.oracle_process_id=proc.spid(+) and proc.addr = ses.paddr(+) and dest.name='user_dump_dest' and dbnm.name='db_name' and req.concurrent_program_id = prog.concurrent_program_id and req.program_application_id = prog.application_id and prog.application_id = execname.application_id and prog.executable_id=execname.executable_id;
This method should be used when there is requirement to capture trace for processes in related products like INV, OM, WIP etc. initiated by Receiving Transaction Processor. This method enables and Event 10046 Level 12 database trace for the entire session of the user for whom the profile is enabled. The session can be linked to an online Form, a Concurrent Program, or any other piece of code that requires accessing the database. Hence, this method must be used carefully as it can generate many trace files as user navigates through the applications.
Steps to generate trace file :
BEGIN FND_CTL.FND_SESS_CTL('','', '', 'TRUE','','ALTER SESSION SET TRACEFILE_IDENTIFIER='||''''||'RCVTRACE' ||''''||' EVENTS ='||''''|| '10046 TRACE NAME CONTEXT FOREVER, LEVEL 12 '||''''); END;
Location of the trace file:
select name, value from v$parameter where name like 'user_dump_dest';