Database Reference
In-Depth Information
Syntax
DBMS_SYSTEM.WAIT_FOR_EVENT(
event IN VARCHAR2,
extended_id IN BINARY_INTEGER,
timeout IN BINARY_INTEGER);
Parameters
Parameter
Description
event
Name of a wait event; corresponds to V$EVENT_NAME.NAME
extended_id
Additional information on the event
timeout
Time to wait for an event (in seconds)
Usage Notes
The session waits for the time-out period specified and populates the column V$SESSION_
WAIT.EVENT with the value of the parameter EVENT and V$SESSION_WAIT.P1 with the value of the
parameter EXTENDED_ID . For wait events that have more than just one parameter, the remaining
parameters are set to default values, which limits the usefulness of the procedure for testing
extended SQL trace profilers. In Oracle9 i , EXTENDED_ID is emitted to a trace file in the format
p1= extended_id , whereas in Oracle10 g the format is field_name = extended_id , where field_name
may be retrieved from V$EVENT_NAME.PARAMETER1 as shown in the next section. If event is not a
valid event from V$EVENT_NAME , the exception “ORA-29352: event ' event_name ' is not an internal
event” is raised.
Examples
SQL> CONNECT / AS SYSDBA
Connected.
SQL> ALTER SESSION SET EVENTS '10046 TRACE NAME CONTEXT FOREVER, LEVEL 8';
Session altered.
SQL> EXECUTE dbms_system.wait_for_event('db file scattered read', 1, 1);
PL/SQL procedure successfully completed.
SQL> EXECUTE dbms_system.wait_for_event('index block split', 204857603, 1);
PL/SQL procedure successfully completed.
SQL> ORADEBUG SETMYPID
Statement processed.
SQL> ORADEBUG TRACEFILE_NAME
/opt/oracle/admin/ten/udump/ten_ora_2928.trc
SQL> !egrep 'scattered|split' /opt/oracle/admin/ten/udump/ten_ora_2928.trc
BEGIN dbms_system.wait_for_event('db file scattered read', 1, 1); END;
WAIT #1: nam='db file scattered read' ela= 993052 file#=1 block#=0 blocks=0 obj#=-1
tim=456558169208
Search WWH ::




Custom Search