Home > Blogroll, dba > oradebug tracefile_name

oradebug tracefile_name

April 10th, 2008

I have enabled tracing in a session and now I want to retrieve the name of the tracefile.

Ex: my session has sid 335.

How do I retrieve trace file name from sqlplus ?


select pid from v$process where addr in 
(select paddr from v$session where sid=335);

       PID
----------
        47

Now I can use oradebug to reveal tracefile name


SQL> oradebug setorapid 47
Unix process pid: 1372408, image: oracle@dbsrv01 (TNS V1-V3)
SQL> oradebug tracefile_name
/u01/app/oracle/admin/LSC01/udump/lsc01_ora_1372408.trc

Read valuable information about oradebug on this site, amoung others

Bookmark and Share

  1. April 10th, 2008 at 16:36 | #1

    I just found another valuable information to find out file name without oradebug :

    http://blog.psftdba.com/2006/12/retrieving-oracle-trace-files-via.html

    SELECT LOWER(d.name)||'_ora_'||p.spid
    ||DECODE(p.value,'','','_'||value) tracefile_name
    FROM v$parameter p, v$database d, sys.v_$session s, sys.v_$process p
    ,(SELECT sid FROM v$mystat WHERE rownum=1) m
    WHERE p.name = 'tracefile_identifier'
    AND s.paddr = p.addr
    AND s.sid = m.sid
    /
    

  2. April 10th, 2008 at 18:16 | #2

    Hi Laurent

    They is an easier way.
    Update to Oracle 11g ;-) and use:

    select value from v$diag_info where name=’Default Trace File’;

    Greetings
    Sven

  3. June 17th, 2008 at 12:57 | #3

    Thanks Sven,
    In 11g I also found :

    SQL> select tracefile from v$process where pid=32;
    TRACEFILE
    --------------------------------------------------------------------------------
    /u01/app/oracle/diag/rdbms/tinf11/TINF11/trace/TINF11_ora_868504.trc
    

  1. No trackbacks yet.