首页 > 开发 > 综合 > 正文

如何获得跟踪文件名称

2024-07-21 02:07:10
字体:
来源:转载
供稿:网友


原文链接:


http://www.eygle.com/faq/how.to.get.tracefile.name.htm


 

当我们使用sql_trace/10046等事件进行进程跟踪时,会生成跟踪文件.跟踪文件名称由以下几部分组成:

<sid>_ora_<pid>.trc

以下脚本用户获得跟踪文件名称:

for unix:

$ sqlplus "/ as sysdba"sql*plus: release 9.2.0.4.0 - production on fri oct 8 12:08:09 2004copyright (c) 1982, 2002, oracle corporation. all rights reserved.connected to:oracle9i enterprise edition release 9.2.0.4.0 - 64bit productionwith the partitioning, olap and oracle data mining optionsjserver release 9.2.0.4.0 - productionsql> set echo onsql> @gettrcnameunixsql> select d.value 2 || '/' 3 || lower (rtrim (i.instance, chr (0))) 4 || '_ora_' 5 || p.spid 6 || '.trc' trace_file_name 7 from (select p.spid 8 from v$mystat m, v$session s, v$process p 9 where m.statistic# = 1 and s.sid = m.sid and p.addr = s.paddr) p, 10 (select t.instance 11 from v$thread t, v$parameter v 12 where v.name = 'thread' 13 and (v.value = 0 or t.thread# = to_number (v.value))) i, 14 (select value 15 from v$parameter 16 where name = 'user_dump_dest') d 17 /trace_file_name--------------------------------------------------------------------------------/opt/oracle/admin/hsbill/udump/hsbill_ora_29630.trc

for nt:

 

 sql> select d.value 2 || '/' 3 || lower (rtrim (i.instance, chr (0))) 4 || '_ora_' 5 || p.spid 6 || '.trc' trace_file_name 7 from (select p.spid 8 from v$mystat m, v$session s, v$process p 9 where m.statistic# = 1 and s.sid = m.sid and p.addr = s.paddr) p, 10 (select t.instance 11 from v$thread t, v$parameter v 12 where v.name = 'thread' 13 and (v.value = 0 or t.thread# = to_number (v.value))) i, 14 (select value 15 from v$parameter 16 where name = 'user_dump_dest') d 17 /trace_file_name--------------------------------------------------------------------------------e:/oracle/admin/eygle/udump/eygle_ora_3084.trc

 

你可以在这里下载以上脚本:forunix fornt

 

本文作者:
eygle,oracle技术关注者,来自中国最大的oracle技术论坛itpub.
www.eygle.com是作者的个人站点.你可通过[email protected]来联系作者.欢迎技术探讨交流以及链接交换.

原文出处:

http://www.eygle.com/faq/how.to.get.tracefile.name.htm

最大的网站源码资源下载站,

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表