Find Trace File
トレースファイルの特定

http://www.builder.com.cn/2007/0910/497699.shtml
http://www.eygle.com/archives/2007/09/11g_tracefile_name.html

-- under 11g 
-- sql 1
SELECT    a.VALUE || b.symbol || c.instance_name || '_ora_' || d.spid || '.trc' trace_file
  FROM (SELECT VALUE FROM v$parameter WHERE NAME = 'user_dump_dest') a,
       (SELECT SUBSTR (VALUE, -6, 1) symbol FROM v$parameter
         WHERE NAME = 'user_dump_dest') b,
       (SELECT instance_name FROM v$instance) c,
       (SELECT spid FROM v$session s, v$process p, v$mystat m
         WHERE s.paddr = p.addr AND s.SID = m.SID AND m.statistic# = 0) d
;
 
-- sql 2
select
  u_dump.value   || '/'     ||
  db_name.value  || '_ora_' ||
  v$process.spid ||
  nvl2(v$process.traceid,  '_' || v$process.traceid, null )
  || '.trc'  "Trace File"
from
             v$parameter u_dump
  cross join v$parameter db_name
  cross join v$process
        join v$session
          on v$process.addr = v$session.paddr
where
 u_dump.name   = 'user_dump_dest' and
 db_name.name  = 'db_name'        and
 v$session.audsid=sys_context('userenv','sessionid');
 
-- after 11g
-- trace file name of current session
SELECT VALUE FROM V$DIAG_INFO WHERE NAME = 'Default Trace File';
-- trace file name for all processes
select program,TRACEFILE from v$process;