SET ECHO off
REM NAME: TFSEVENT.SQL
REM USAGE:"@path/tfsevent"
REM ------------------------------------------------------------------------
REM REQUIREMENTS:
REM Must be run as SYS
REM ------------------------------------------------------------------------
REM AUTHOR:
REM Anonymous
REM Copyright 1996, Oracle Corporation
REM ------------------------------------------------------------------------
REM PURPOSE:
REM This will report all events set in the current session and
REM their level.
REM ------------------------------------------------------------------------
REM EXAMPLE:
REM SQL> @events
REM
REM Event 10232 set at level 10
REM
REM PL/SQL procedure successfully completed.
REM
REM ------------------------------------------------------------------------
REM DISCLAIMER:
REM This script is provided for educational purposes only. It is NOT
REM supported by Oracle World Wide Technical Support.
REM The script has been tested and appears to work as intended.
REM You should always run new scripts on a test instance initially.
REM ------------------------------------------------------------------------
REM Main text of script follows:

set serveroutput on

prompt

declare
event_level number;
begin
for i in 10000..10999 loop
dbms_system.read_ev(i,event_level);
if (event_level > 0) then
dbms_output.put_line('Event '||to_char(i)||' set at level '||
to_char(event_level));
end if;
end loop;
end;
/

----------- cut ---------------------- cut -------------- cut --------------


=========
Examples:
=========

SQL> @events

Event 10232 set at level 10

PL/SQL procedure successfully completed.