通过ORADEBUG运用10046事件跟踪SQL语句
查看oradebug的帮助信息:
SQL> oradebug help
SQL>select * from v$session_wait ----查询有问题的等待事件
SQL>select * from v$session where sid='' 根据上面语句取得SID查询
SQL>select * from v$process where addr= '' 根据上面语句的PADDR取得
这样可以查询出PID,SPID(即OSPID)
SQL>oradebug setospid 5087252或SQL>oradebug setpid 63
oracle pid:63,Unix process pid:5087252,image:oracle@GSX_P595_2_P1(TNS V1-V3)
SQL> oradebug event 10046 trace name contextforever,level 12
Statement processed
SQL> oradebug event 10046 trace name context off
Statement processed
SQL> oradebug tracefile_name
/oracle/admin/.../udump/XXXX_ora_5087252.trc
然后查看生成的文件XXXX_ora_5087252.trc即可。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/543979/viewspace-676691/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/543979/viewspace-676691/