Oracle System Triggers – the list and sample script

Posted by Jiltin     23 February, 2009    1,072 views   

Oracle System triggers can be delineated into two categories: those based on Data Definition Language (DDL) statements, and those based upon database events. Use of system triggers can greatly expand a DBA’s ability to monitor database activity and events.

Event Applicable
STARTUP AFTER
SHUTDOWN BEFORE
SERVERERROR AFTER
LOGON AFTER
LOGOFF BEFORE
CREATE BEFORE and AFTER
DROP BEFORE and AFTER
ALTER BEFORE and AFTER

Sample Trigger statement

CREATE TRIGGER TRG_LOGON after logon ON DATABASE
begin
IF (user=‘SUB’) then
execute immediate ‘alter session set tracefile_identifier = TEST_TEST’;
EXECUTE IMMEDIATE ‘alter session set MAX_DUMP_FILE_SIZE = unlimited’;
execute immediate ‘alter session set TIMED_STATISTICS = TRUE’;
execute immediate ‘alter session set events ‘‘10046 trace name context forever, level 8′;
end IF;
end ;

Post to Twitter  Post to Delicious  Post to Digg    Post to StumbleUpon

Categories : Scripts Oracle Tags :

Comments

No comments yet.


Leave a comment

(required)

(required)