Oracle强大的Trace跟踪方法(二)

(4) DBMS_SUPPORT包(同10046 level 12效果一致)

此方法使用之前需要执行如下脚本安装:
SQL> @?/rdbms/admin/dbmssupp.sql  
SQL> @?/rdbms/admin/prvtsupp.plb 

exec sys.dbms_support.start_trace ;   --跟踪当前SESSION
exec sys.dbms_support.stop_trace ;    --停止跟踪当前SESSION

exec dbms_support.start_trace_in_session(4,1); --跟踪OTHER SESSION

exec dbms_support.stop_trace_in_session(4,1); --停止跟踪OTHER SESSION

trace2-1

 

5) dbms_system.SET_BOOL_PARAM_IN_SESSION

  ( 同alter session set sql_trace=ture一致,无BIND信息,无WAIT信息)

exec sys.dbms_system.SET_BOOL_PARAM_IN_SESSION(2506,3317,'sql_trace',TRUE); 
exec sys.dbms_system.SET_BOOL_PARAM_IN_SESSION(2506, 3317,'sql_trace',FALSE);

lock2-2

(6) dbms_system.set_ev  (同10046效果一致)

exec dbms_system.set_ev(1876, 2153, 10046, 12, '');
exec dbms_system.set_ev(1876, 2153, 10046, 0, '');

trace2-4

(7) dbms_system.set_sql_trace_in_session

(同alter session set sql_trace=ture一致,无BIND,无WAIT)

 exec dbms_system.set_sql_trace_in_session(3759,34707,TRUE);
 exec dbms_system.set_sql_trace_in_session(3759,34707,FALSE);

trace2-3