Wednesday, July 29, 2009

Event 10046 Tracing (Other's session)

Method 1: Using oradebug utility

Get the SPID of the session you want to trace.
SQL> Select p.spid, p.pid From v$session s, v$processs p
Where s.paddr = p.addr
And s.sid = 149 And s.serial#= 3643

$ sqlplus / as sysdba
SQL> oradebug setospid 12345;
-- 12345 is the p.spid value from the above query.

SQL> oradebug unlimit;
SQL> oradebug event 10046 trace name context forever, level 8;

-- To turn off tracing
SQL> oradebug event 10046 trace name context off;

Method 2: Using DBMS_MONITOR package in 10g or DBMS_SUPPORT package

SQL> Exec DBMS_MONITOR.session_trace_enable(149,3643, TRUE, TRUE)
SQL> Exec DBMS_MONITOR session_trace_disable(149,3643)

or

SQL> Exec DBMS_SUPPORT.START_TRACE_IN_SESSION (149,3643, TRUE, TRUE);
SQL> Exec DBMS_SUPPORT.STOP_TRACE_IN_SESSION (149,3643);

Thanks

No comments:

Followers

Powered By Blogger
 

Oracle Database Administration. Copyright 2008 All Rights Reserved Revolution Two Church theme by Brian Gardner Converted into Blogger Template by Bloganol dot com