<< Back to previous view

[QA-9] How to set an event in other session ? Created: 15/Jul/07  Updated: 16/Sep/07

Status: Closed
Project: Questions & Answers
Fix Version/s: None

Type: Oracle - Administration Priority: Major
Reporter: ubTools Support Assignee: ubTools Support
Resolution: Answered Votes: 0

Product Version: ???
Operating System: Generic

 Description   
How to set an event in other session ?

 Comments   
Comment by ubTools Support [ 15/Jul/07 01:19 PM ]

Answer:

Use SYS.DBMS_SYSTEM.SET_EV() procedure. Here is the specification for this procedure:

 
PROCEDURE SET_EV
Argument Name                  Type                    In/Out Default?
------------------------------ ----------------------- ------ --------
SI                             BINARY_INTEGER          IN
SE                             BINARY_INTEGER          IN
EV                             BINARY_INTEGER          IN
LE                             BINARY_INTEGER          IN
NM                             VARCHAR2                IN
  • SID: V$SESSION.SID
  • SE: V$SESSION.SERIAL#
  • EV: Event number. For example:
    • 10046: SQL traces.
    • 10053: Optimizer traces.
    • NNN : ORA-NNN errors.
    • 65535: IMMEDIATE traces.
  • LE: Event level. For Event 10046 events:
    • 0: Disable event.
    • 1: PARSE, FETCH, EXEC, EXECUTION PLAN
    • 4: Level 1 + BINDS
    • 8: Level 1 + WAITS
    • 12: Level 4 + Level 8
  • NM: Event name. For example:
    • ERRORSTACK.......: For error stack traces.
    • PROCESSSTATE...: For process states
    • SYSTEMSTATE.......: For System states.
    • ''..................................: For CONTEXT FOREVER.

Sample:

Dumps PROCESSSTATE trace IMMEDIATELY in LEVEL 10:

 
SQL> exec dbms_system.set_ev(8,1056,65535,10,'PROCESSSTATE');

Dumps ERRORSTACK trace in LEVEL 3 on ORA-942 error:

 
SQL> exec dbms_system.set_ev(8,1060,942,3,'ERRORSTACK');

Dumps Event 10046 trace in LEVEL 8 for CONTEXT FOREVER:

 
SQL> exec dbms_system.set_ev(8,1060,10046,8,'');
Generated at Sat Dec 27 15:52:17 UTC 2025 using JIRA Standard Edition, Version: 3.12.3-#302.