Hi all,
I am using Oracle 11g on windows 2003 server R2 standard edition service pack 2. I am trying to create a trigger within a schema called "inventory" by logging in as the schema owner. Here is my code for the same:
The aim is to fire the trigger whenever alter or drop occurs on a database object(ie any database object). So I created a table called trigtest like this within the same schema as the trigger:
Then I tried dropping the table:
This is what I got as serveroutput after the drop statement :
ALTER
DROP
I have attached the whole operation as an attachment while this was being executed in SQLPLUS. Can someone please throw some light as to why both the alter and drop events are being fired when only the drop statement is called?
I am using Oracle 11g on windows 2003 server R2 standard edition service pack 2. I am trying to create a trigger within a schema called "inventory" by logging in as the schema owner. Here is my code for the same:
Code:
create or replace TRIGGER AUDIT_SYS_TR_TEST AFTER ALTER OR DROP ON DATABASE BEGIN IF(ora_sysevent = 'DROP' AND UPPER(ora_login_user) not in ('SYS','SYSTEM')) THEN DBMS_OUTPUT.PUT_LINE(ora_sysevent); ELSIF(ora_sysevent = 'ALTER' AND UPPER(ora_login_user) not in ('SYS','SYSTEM')) THEN DBMS_OUTPUT.PUT_LINE(ora_sysevent); END IF; END;
Code:
CREATE TABLE TRIGTEST(COL1 VARCHAR(20));
Code:
DROP TABLE TRIGTEST;
ALTER
DROP
I have attached the whole operation as an attachment while this was being executed in SQLPLUS. Can someone please throw some light as to why both the alter and drop events are being fired when only the drop statement is called?