如何獲得追蹤檔案名稱

來源:互聯網
上載者:User
檔案名稱

原文連結:


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是作者的個人網站.你可通過Guoqiang.Gai@gmail.com來聯絡作者.歡迎技術探討交流以及連結交換.

原文出處:

http://www.eygle.com/faq/How.To.Get.Tracefile.Name.htm


相關文章

Cloud Intelligence Leading the Digital Future

Alibaba Cloud ACtivate Online Conference, Nov. 20th & 21st, 2019 (UTC+08)

Register Now >

Starter Package

SSD Cloud server and data transfer for only $2.50 a month

Get Started >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。