Get trace files generated by the sender process

Directly open the database instance level sql_trace is unrealistic, will all be connected to the oracle session has produced sql_trace, it will produce a large number of trace files (junk files), so as to track specific information sql process, can produce the characteristics of the process sql_trace document, the following steps:

1, the process of obtaining sender sid, serial #, spid

select a.process,a.program,a.saddr,a.sid,a.serial#,a.paddr,b.spid,b.username,b.program

 from v$session a,v$process b

 where a.paddr=b.addr

 and a.program like 'sender%'

 and a.osuser='dsg'

 order by 1;

( Man Come network - serving the block chain entrepreneurs, technology and the owners of the site http://www.manxinet.com )

2, open sql_trace tracking sender process

SQL> alter session set sql_trace = true;

SQL> exec SYS.DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION =(SID,SERIAL#,TRUE);

In order to generate a trace file must generate new transaction after that sender process must have things happen to produce the corresponding file sql_trace Note:

( Man Come network - serving the block chain entrepreneurs, technology and the owners of the site http://www.manxinet.com )

3, close sender process tracking sql_trace

After tracking sql period of time, should not forget to turn off sender process sql_trace 

SQL> exec SYS.DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION =(SID,SERIAL#,FALSE);

 

4, format the trace file using tkprof  

Guess you like

Origin www.cnblogs.com/moonfans/p/11365870.html