In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article will explain in detail how to use 10046 events in SQL to expand SQL tracking. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
On the basis of session sql_trace, using 10046 to diagnose events, we can expand the function of sql_trace, mainly reflected in the tracking of binding variables and waiting events.
10046 Diagnostic events can be set at four levels:
Level 1
Enable standard SQL tracing, equivalent to sql_trace
Level 4
Level 1 + binding variable information
Level 8
Level 1 + waits for event information
Level 12
Level 1 + level 4 + level 8
Enable 10046 event tracking for your own session
Alter session set events' 10046 trace name context forever,level 12'
Turn off 10046 event tracking
Alter session set events' 10046 trace name context off'
There are several ways to set up a trace for a specified session:
1. Through the package dbms_monitor
Turn on tracking
Exec dbms_monitor.session_trace_enable (, waits = > true, binds = > true)
Turn off tracking
Exec dbms_monitor.session_trace_disable (,)
2. Through the package dbms_system
Turn on tracking
Exec dbms_system.set_ev (, 10046, 12,')
Turn off tracking
Exec dbms_system.set_ev (, 10046, 0,'')
3. Through oradebug
Turn on tracking
Oradebug setorapid; or oradebug setospid
Oradebug session_event 10046 trace name context forever, level 12
Determine the trace file path
Oradebug tracefile_name
Turn off tracking
Oradebug event 10046 trace name context off
The event number and level of the current session can be obtained with the following code
Set serveroutput on
Declare
Event_level number
Begin
For event_number in 10000.. 10999 loop
Dbms_system.read_ev (event_number, event_level)
If (event_level > 0) then
Dbms_output.put_line ('Event' | | to_char (event_number) | |
'is set at level' | |
To_char (event_level))
End if
End loop
End
/
This is the end of this article on "how to use 10046 events in SQL to expand SQL tracking". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.