A note on tracing concurrent programs. This is usefull for investigating
performance problems or retrieving the SQL statements executed by the program.
1. Get details on the program:
sqlplus system/password
select sid, serial#, program
from v$session
where username like '%APPS%'
and program like '%FADEPR%'
/
NOTE : SID and SERIAL#
where username is apps schema / user name
There may be multiple running programs, ensure the correct program is
traced.
2. Enable tracing:
sqlplus sys/password
execute dbms_system.set_sql_trace_in_session(SID,SERIAL#,true);
3. Disable tracing:
sqlplus sys/password
execute dbms_system.set_sql_trace_in_session(SID,SERIAL#,false);
OR let program finish.
4. Get a formatted view of the trace:
tkprof tracefile outfile.prv explain=apps/apps
or
tkprof tracefile outfile.prv sys=no
Trace file will be written to USER_DUMP_DEST
This method is ideal when a program is in a running state and needs to be
traced.
阅读(1200) | 评论(0) | 转发(0) |