--设置标识
alter session set tracefile_identifier='abc';
---------方法1----------
alter session set events '10046 trace name context forever,level 12';
alter session set events '10046 trace name context off';
----------方法2---------
exec dbms_system.set_ev(18, 226, 10046, 12, '');
exec dbms_system.set_ev(18, 226, 10046, 0, '');
----------方法3---------
exec dbms_system.set_sql_trace_in_session(18,226,TRUE);
exec dbms_system.set_sql_trace_in_session(18,226,FALSE);
----------方法4---------
oradebug setospid xxxx
oradebug event 10046 trace name context forever, level 12;
oradebug event 10046 trace name context off ;
复杂的看 https://cloud.tencent.com/developer/article/1678571
其中 dbms_monitor 比较强大,可以开启对 database、service、module、action 层面的跟踪。
阅读(793) | 评论(0) | 转发(0) |