How to obtain a trace file name

Source: Internet
Author: User
Tags chr rtrim thread
Filename

Original link:


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




Trace files are generated when we use events such as sql_trace/10046 for process tracking. The trace file name consists of the following parts:

<sid>_ora_<pid>.trc

The following script user obtains the trace file name:

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 M Ining 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.Si D = M.sid and p.addr = s.paddr) p, SELECT t.instance one from V$thread T, V$parameter v WHERE v.name = ' thread ' A ND (v.value = 0 OR t.thread# = to_number (v.value))) I (SELECT VALUE from v$parameter WHERE NAME = ' User_dump_de St ') 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.Si D = M.sid and p.addr = s.paddr) p, SELECT t.instance one from V$thread T, V$parameter v WHERE v.name = ' thread ' A ND (v.value = 0 OR t.thread# = to_number (v.value))) I (SELECT VALUE from v$parameter WHERE NAME = ' User_dump_de St ') d 17/trace_file_name--------------------------------------------------------------------------------e:\ Oracle\admin\eygle\udump\eygle_ora_3084.trc



You can download the above script here: Forunix fornt



The author of this article:
Eygle,oracle technology concern, from China's largest Oracle technology forum Itpub.
Www.eygle.com is the author's personal site. You can contact the author by Guoqiang.Gai@gmail.com. Welcome technical discussions and exchange of links.

Original source:

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


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.