联系:手机/微信(+86 17813235971) QQ(107644445)
作者:惜分飞©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]
使用oradebug
session 1 --查询出需要跟踪会话v$process.pid session 2 SQL> oradebug SETORAPID 15 Unix process pid: 14851, image: oracle@xifenfei (TNS V1-V3) SQL> oradebug EVENT 10046 TRACE NAME CONTEXT FOREVER, LEVEL 4 Statement processed. --执行session 1 session 1 SQL> oradebug EVENT 10046 trace name context off Statement processed. SQL> oradebug TRACEFILE_NAME /u01/oracle/admin/xifenfei/udump/xff_ora_14851.trc
使用dbms_system.set_sql_trace_in_session
session 1 --查询出需要跟踪会话的sid,SERIAL# session 2 SQL> exec dbms_system.set_sql_trace_in_session(12,130,true); PL/SQL procedure successfully completed. --session 1执行sql session2关闭跟踪 SQL> exec dbms_system.set_sql_trace_in_session(12,130,false); PL/SQL procedure successfully completed. --通过session 1找出trace文件