oracle获取当前session的trace文件名
获取默认文件名SQL如下:
创新互联公司专注于湛河网站建设服务及定制,我们拥有丰富的企业做网站经验。 热诚为您提供湛河营销型网站建设,湛河网站制作、湛河网页设计、湛河网站官网定制、小程序定制开发服务,打造湛河网络公司原创品牌,更为您提供湛河网站排名全网营销落地服务。
--第1种 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'); --第2种 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
新闻标题:oracle获取当前session的trace文件名
URL标题:http://scpingwu.com/article/iisgop.html