AFTER DDL ON SCHEMA : Schema Trigger « Trigger « Oracle PL/SQL Tutorial






SQL>
SQL>
SQL> CREATE OR REPLACE TRIGGER no_create
  2  AFTER DDL ON SCHEMA
  3  BEGIN
  4    IF ORA_SYSEVENT = 'CREATE' THEN
  5      RAISE_APPLICATION_ERROR(-20000,'Cannot create the ' || ORA_DICT_OBJ_TYPE ||
  6                                     ' named '            || ORA_DICT_OBJ_NAME ||
  7                                     ' as requested by '  || ORA_DICT_OBJ_OWNER);
  8    END IF;
  9  END;
 10  /

Trigger created.

SQL>
SQL>
SQL> drop trigger no_create;

Trigger dropped.








28.13.Schema Trigger
28.13.1.Schema trigger
28.13.2.AFTER CREATE ON SCHEMA
28.13.3.AFTER DDL ON SCHEMA
28.13.4.AFTER SUSPEND ON SCHEMA
28.13.5.use event attributes to provide more info
28.13.6.ORA_DICT_OBJ_TYPE, ORA_DICT_OBJ_OWNER, ORA_DICT_OBJ_NAME