本文共 1145 字,大约阅读时间需要 3 分钟。
禁止DDL执行的trigger
CREATE OR REPLACE TRIGGER disable_ddlBEFORE DDL ON SCHEMABEGIN IF ora_sysevent <> 'TRUNCATE' and not (ora_sysevent = 'ALTER' AND ora_dict_obj_type = 'PROCEDURE') and not (ora_sysevent = 'CREATE' AND ora_dict_obj_type = 'PROCEDURE') and not (ora_sysevent = 'ALTER' AND ora_dict_obj_type = 'TRIGGER') and not (ora_sysevent = 'CREATE' AND ora_dict_obj_type = 'TRIGGER') and not (ora_sysevent = 'ALTER' AND ora_dict_obj_type = 'VIEW') and not (ora_sysevent = 'CREATE' AND ora_dict_obj_type = 'VIEW') and not (ora_sysevent = 'ALTER' AND ora_dict_obj_type = 'FUNCTION') and not (ora_sysevent = 'CREATE' AND ora_dict_obj_type = 'FUNCTION') THEN RAISE_APPLICATION_ERROR(-20110,'No DDL in any time, please contact DBA team If you turly need it.',TRUE); END IF;END;SQL> create table justin (id number(10));
create table justin (id number(10)) ORA-00604: error occurred at recursive SQL level 1ORA-20110: No DDL in any time, please contact DBA team If you turly need it.ORA-06512: at line 12来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/15480802/viewspace-709459/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/15480802/viewspace-709459/