首页 > 代码库 > Oracle-SQL_TRACE使用

Oracle-SQL_TRACE使用

select sid,serial# from v$session where schemaname=‘SCOTT‘;


select p.spid
  from v$session s, v$process p
 where s.paddr = p.addr
   and s.sid = &1
   and s.serial# = &2;
   
exec dbms_monitor.session_trace_enable(sid,serial#,waits=>true,binds=>true);
exec dbms_monitor.session_trace_disable(sid,serial#); 


exec dbms_system.set_ev(sid,serial#,10046,12,‘‘);

exec dbms_system.set_ev(sid,serial#,10046,0,‘‘);


tkprof JAY_ora_4138.trc analyzing2.log sys=no aggregate=yes explain=scott/tiger

Oracle-SQL_TRACE使用