1:触发日志
参数文件设置
EVENT "942 trace name ERRORSTACK level 3"
当任何错误产生都会产生相应错误TRACE文件
2:跟踪其他会话SQL
Obtain the Oracle process identifier or the Operating System process
identifier (SPID) from v$process in an MTS environment:
sqlplus /nolog
SQL> connect / as sysdba
SQL> select pid, spid from v$process p, v$shared_server s
2 where p.addr = s.paddr;
PID SPID
---------- ------------
14 6976
2. Attach to the process using ORADEBUG.
Using the Oracle process identifier:
SQL> oradebug setorapid 8
Unix process pid: 25807, image: oracleV804
- or -
Using the Operating System process identifier:
SQL> oradebug setospid 25807
Oracle pid: 8, Unix process pid: 25807, image: oracleV804
3. Turn on SQL Trace for the session.
SQL> oradebug event 10046 trace name context forever, level 12
Statement processed.
4. Turn off the SQL trace for the session.
SQL> oradebug event 10046 trace name context off
5. Format trace file using TKPROF.