How to use Oracle 10046 tracking events

Source: Internet
Author: User

1. Turn on 10046 trace events

Alter session SET Events ' 10046 Trace name Context forever, Level 12 ';

If you want to make it easier to identify the trace file, you can set the trace's identity before opening the event

Alter session set tracefile_identifier= ' YBB ';

When this is done, the trace file name is added YBB

2. Execute the SQL statement to be traced (there is SQL execution in the corresponding trace file)

SELECT * from dba_users where username= ' SCOTT ';

3. Stop 10046 Event Tracking

Alter session SET Events ' 10046 Trace name context off ';

4. Locate the trace file for this build

SELECT DISTINCT (M.SID), p.pid,p.tracefile from V$mystat m,v$session s,v$process p where m.sid=s.sid and s.paddr=p.addr;

5. Format the file output with the Tkprof tool

How to use Oracle 10046 tracking events

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.