« 使用dbms_rowid包获得rowid的详细信息 | Blog首页 | 使用触发器实现数据库级守护,防止DDL操作 »
如何获得跟踪文件名称
作者:eygle | 【转载请注出处】|【云和恩墨 领先的zData数据库一体机 | zCloud PaaS云管平台 | SQM SQL审核平台 | ZDBM 数据库备份一体机】
链接:https://www.eygle.com/archives/2004/12/howto_get_trace_filename.html
链接:https://www.eygle.com/archives/2004/12/howto_get_trace_filename.html
当我们使用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 2004 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved. Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production With the Partitioning, OLAP and Oracle Data Mining options JServer Release 9.2.0.4.0 - Production SQL> set echo on SQL> @gettrcnameunix 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 -------------------------------------------------------------------------------- /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
历史上的今天...
>> 2016-12-16文章:
>> 2013-12-16文章:
>> 2011-12-16文章:
>> 2008-12-16文章:
>> 2006-12-16文章:
>> 2005-12-16文章:
By eygle on 2004-12-16 19:59 | Comments (0) | FAQ | 110 |