Oracle gets the trace file name of the current session

Source: Internet
Author: User

Get the default file name SQL as follows:

--1th Type 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 ');--2nd kind of 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


This article is from the "Long Way to repair ..." Blog, be sure to keep this source http://baser.blog.51cto.com/4153192/1599026

Oracle gets the trace file name of the current session

Related Article

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.