Wednesday, September 23, 2009

Find Oracle Trace File

When looking for an oracle trace file here are a 2 sqls that will help you out. First ascertain the SID then run sql 1 to get the ospid. Then run sql 2 to get the trace file.

Sql 1
select p.PID,p.SPID,s.SID
from v$process p,v$session s
where s.paddr = p.addr
and s.sid = &SESSION_ID
/
Then user the spid ( server process identifier ) to get the location of the tracefile.
SELECT PID, PROGRAM, TRACEFILE FROM V$PROCESS where pid= &spid

To turn on trace event 10046 you can use the oradebug

connect / as sysdba
oradebug setospid
oradebug unlimit
oradebug event 10046 trace name context forever,level 12

No comments:

Post a Comment