Oracle Learning----Trace Files

Source: Internet
Author: User

1. View V$diag_info view, can see the location of the trace file, the specific name and other information.

Name column, Diag Trace is where the 11g trace file is located

The Default trace file is the trace file name of the current session

2. Query can generate trace file name
Select
c.value| | ' \ ' | | d.instance_name| | ' _ora_ ' | | a.spid| | '. TRC ' | |
Case where E.value is isn't null then ' _ ' | | E.value End as Trace
From v$process a,v$session b,v$parameter c,v$instance d,v$parameter E
where a.addr=b.paddr
and b.audsid=userenv (' SessionID ')
and C.name= ' User_dump_dest '
and E.name= ' Tracefile_identifier ';
Note: Under Linux '/' under Windows ' \ '

3. Enable trace files and generate trace files
EXEC dbms_monitor.session_trace_enable

4. Set some identification for the trace file, so that you can find the trace file when you do not have access to the v$process v$session
Alter session set tracefile_identifier= ' Look_for_me ';

Sql> alter session set tracefile_identifier= ' Look_for_me ';

The session has changed.

sql> exec dbms_monitor.session_trace_enable;

The PL/SQL process has completed successfully.

Sql> Select
2 c.value| | ' \ ' | | d.instance_name| | ' _ora_ ' | | a.spid| | '. TRC ' | |
3 case when E.value was not null and then ' _ ' | | E.value End as Trace
4 from v$process a,v$session b,v$parameter c,v$instance d,v$parameter E
5 Where A.ADDR=B.PADDR
6 and B.audsid=userenv (' SessionID ')
7 and C.name= ' User_dump_dest '
8 and E.name= ' Tracefile_identifier ';

TRACE
---------------------------------------------------------------------------

D:\app\administrator\diag\rdbms\roc\roc\trace\roc_ora_4848.trc_look_for_me

Oracle Learning----Trace Files

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.