Many times, performance diagnostics on a database can be done using SQL tracking, and some information is then parsed in the trace file. In general, we can set up the SQL Trace by initializing the parameter sql_trace=true.
We can also set up 10046 events for SQL tracing, and we can set different levels of tracking to get more information than using Sql_trace.
Level 0 Deactivate SQL Trace, equivalent to Sql_trace=false
Level 1 standard SQL Trace, equivalent to Sql_trace=true
Level 4 increases the information of the binding variable on the basis 1
Level 8 increases information on wait events on the basis of 1
Level 12 increases the information of the binding variable and the wait event on the basis of 1
The 10046 event can track not only the user session (the trace file is located in User_dump_dest), but also the background process (the trace file is located in Background_dump_dest). The size of the trace file is determined by 4 factors: the tracking level, the length of the trace, the activity level of the session, and the max_dump_file_size parameters.
Enable Trace Event 10046
1. In the global settings
Modifying initialization parameters
EVENT = "10046 Trace name Context forever, Level 8"
2. In the current session settings
Alter session SET Events ' 10046 Trace name Context forever, Level 8 ';
Alter session SET Events ' 10046 Trace name context off ';
3. Session settings for other users
Get the session ID and serial number of the session you want to track first
Select Sid,serial#,username from v$session where username= ' trace_username ';
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.