oradebug setmypid
oradebug event 10046 trace name context forever,level 12;
分析的sql
查找trc文件
select d.value || '/' || lower(rtrim(i.instance, chr(0))) || '_ora_' ||p.spid|| '.trc' trace_file_name
from (select p.spid
from v$mystat m, v$session s, v$process p
where m.statistic# = 1
and s.sid = m.sid
and p.addr = s.paddr) p,
(select t.instance
from v$thread t, v$parameter v
where v.name = 'thread'
and (v.value = 0 or t.thread# = to_number(v.value))) i,
(select value from v$parameter where name = 'user_dump_dest') d;
alter session set events '10046 trace name context off';
格式化:
tkprof ossdb2_ora_635208.trc session.txt
oradebug event 10046 trace name context forever,level 12;
分析的sql
查找trc文件
select d.value || '/' || lower(rtrim(i.instance, chr(0))) || '_ora_' ||p.spid|| '.trc' trace_file_name
from (select p.spid
from v$mystat m, v$session s, v$process p
where m.statistic# = 1
and s.sid = m.sid
and p.addr = s.paddr) p,
(select t.instance
from v$thread t, v$parameter v
where v.name = 'thread'
and (v.value = 0 or t.thread# = to_number(v.value))) i,
(select value from v$parameter where name = 'user_dump_dest') d;
alter session set events '10046 trace name context off';
格式化:
tkprof ossdb2_ora_635208.trc session.txt
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30491527/viewspace-1995039/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/30491527/viewspace-1995039/