Get the default file name SQL as follows:
--1th Type select u_dump.value | | '/' | | lower (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 ');--2nd kind of select d.value | | '/' | | lower (Rtrim (I.INSTANCE, CHR (0)) | | ' _ora_ ' | | p.spid | | ' TRC ' AS ' Trace_file_Name " FROM (select p.spid from V$mystat m, V$session s, V$process p WHERE m.Statistic# = 1 and s.sid = m.sid and  P.ADDR = S.PADDR) p, (select t.instance from v$thread t, v$parameter v WHERE v.Name = ' thread ' AND (v.value = 0 or t.thread# = to_number (V.value)) i, (select value FROM V$parameter WHERE name = ' user_dump_dest ') d;
eg
/data03/dev4/db/9.2.0/admin/dev4_mistest/udump/dev4_ora_9359834.trc
This article is from the "Long Way to repair ..." Blog, be sure to keep this source http://baser.blog.51cto.com/4153192/1599026
Oracle gets the trace file name of the current session