Each event has a number that is the same as the Oracle error message. Such as 10046 and ORA-10046
Each event has a level, which can be the following:
Range 1 to 10
Bit 0x01 0x02 0x04 0x08 0x10
Identification 0=off,1=on
ID Number object ID (objects ID), memory address (memory addresses)
Note that events vary from one version to the next. There are some things that may be controversial or unusable, and often they will be replaced by new events. Also note that in the current version the message file does not necessarily reflect events.
Many events affect the behavior of the database, and some test events are most likely to cause the database to drop. So, without Oracle support, It is best not to do events on the pro system. Dev system if you want to do events, it is best to make a full backup of the database.
Enabling events (Enable event)
Events can be enabled at the instance level, mainly in Init.ora files:
Event= ' Event Trace name context forever;
(Red section: event refers to the incident number. Level specifies the rank of the event)
You can enable multiple events at once, in the following two ways:
1. Separated by a colon
event = "10248 Trace name Context forever, level 10:10249 Trace name Context forever, Level 10"
2. Two events separately written
event= "10248 Trace name Context forever, Level 10"
event= "10249 Trace name Context forever, Level" #一些版本的Oracle, event to be the same case
Events can also be used at the instance level using ALTER system commands to enable:
ALTER SYSTEM SET EVENTS ' Event trace name context forever;
At the instance level for the next disable
ALTER SYSTEM SET EVENTS ' Event Trace name context off ';
Events can also be used at the session level using ALTER SESSION commands to enable:
ALTER session SET EVENTS ' event trace name context forever;
At the session level, use the command disable:
ALTER session SET EVENTS ' event Trace name context off ';
Events in the other session with Oradebug to enable:
Implement enable in a process:
Oradebug Event Event TRACE NAME context FOREVER
Enable in a process:
Oradebug Setorapid 8 (PID process number)
Oradebug Event Event TRACE NAME context FOREVER
The following command disable:
Oradebug Event Event TRACE NAME context off
Implement enable in session:
Oradebug session_event EVENT TRACE NAME Context FOREVER
Implement Disable in session:
Oradebug session_event EVENT TRACE NAME context off
Events can also be used Dbms_system. Setev packages to implement enable and disable
(Get Sid and serial# from the V$session view before doing it)
In the following manner: EXECUTE Dbms_system. Set_ev (Sid,serial#,event,level, "")
such as Execute Dbms_system.set_ev (9,29,10046,8, "");
To disable, change the level to 0, such as: EXECUTE Dbms_system.set_ev (9,29,10046,0, ");
Listing All Events: (List all available events)
Most of the events number ranges from 10000 to 10999. You can dump all the information with the following command
SET Serveroutput on
DECLARE
Err_msg VARCHAR2 (120);
BEGIN
Dbms_output.enable (1000000);
For Err_num in 10000..10999
LOOP
Err_msg: = SQLERRM (-err_num);
IF err_msg not like '%message ' | | err_num| | ' Not found% ' THEN
Dbms_output.put_line (ERR_MSG);
End IF;
End LOOP;
End;
/
Under UNIX System The message file is in the bottom directory $oracle_home/rdbms/mesg/oraus.msg
Under NT system The message file is in the bottom directory $oracle_home/rdbms/mesg/oraus.msg
Listing enabled events (list enabled events)
Use the following command to list the Events already enabled in the current session:
ALTER session SET EVENTS ' 10201 Trace name Context forever, Level 1 ';
Event 10220-dump Changes to undo Header-dump the change of the Undo header information
ALTER session SET EVENTS ' 10220 Trace name Context forever, Level 1 ';
Event 10221-dump undo Changes-dump Undo Change
ALTER session SET EVENTS ' 10221 Trace name Context forever, Level 7 ';
Event 10224-dump the split and delete information of the index block splits/deletes-dump
ALTER session SET EVENTS ' 10224 Trace name Context forever, Level 1 ';
Event 10225-dump Changes to Dictionary Managed extents---Dump out of the row cache, the change of the dictionary management extents
ALTER session SET EVENTS ' 10225 Trace name Context forever, Level 1 ';
The Event 10231--setting skips a corrupted block of data when doing a full table scan (when you do exp, if you have a bad block, you can set this to skip the bad blocks when exp exports, so that some of the data can be used)
ALTER SYSTEM SET EVENTS ' 10231 Trace name context forever,level 10 ';
Event 10241-dump Remote SQL Execution-dump execution information
ALTER session SET EVENTS ' 10241 Trace name Context forever, Level 1 ';
Event 10246-trace Pmon Process---can only be done in Init.ora and cannot be done with alter system
event = "10246 Trace name Context forever, Level 1"
Event 10248-trace Dispatcher Processes---done in init.ora (9iDump to Udump directory)
event = "10248 Trace name Context forever, Level 10"
Event 10249-trace Shared Server (MTS) processes---done in init.ora (9iDump to Udump directory)
event = "10249 Trace name Context forever, Level 10"
Event 10270-debug Shared cursors-(not understood)
event = "10270 Trace name Context forever, Level 10"
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.