Home > TSOP > sql trace的几种方式

sql trace的几种方式

汇总下troubleshooting提到的sql trace的几种方式:

1.9i

dbms_session.set_sql_trace

dbms_system.set_sql_trace_in_session

2.10g+

alter session set events '10046 trace name context forever ,level N'

dbms_system.set_ev(
si=>$sid, --sid
se=>$serial#, --serial#
ev=>10046, --event number
le=>[0|1|4|8|12], --level
nm=>null --name ,usually null
)

dbms_monitor.SESSION_TRACE_ENABLE(  --对应的关闭就是session_trace_disable
SESSION_ID=>$sid,
SERIAL_NUM=>$serial#,
WAITS=>true,  --level 8
binds=>true    --level 4
)
Categories: TSOP Tags:
  1. No comments yet.
  1. No trackbacks yet.