CREATE OR REPLACE TRIGGER no_create_dblink
BEFORE DDL ON DATABASE
BEGIN
IF ORA_SYSEVENT = 'CREATE' and ORA_DICT_OBJ_TYPE='DATABASE LINK'
THEN
RAISE_APPLICATION_ERROR (-20000, 'Cannot create the ' || ORA_DICT_OBJ_TYPE ||' named ' || ORA_DICT_OBJ_NAME ||
' as requested by ' || ORA_DICT_OBJ_OWNER ||'联系管理员');
END IF;
END;
/
验证:
create public database link to_11 connect to scott identified by tiger using 'bylw';
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-20000: Cannot create the DATABASE LINK named TO_11 as requested by
??????????
ORA-06512: at line 4
BEFORE DDL ON DATABASE
BEGIN
IF ORA_SYSEVENT = 'CREATE' and ORA_DICT_OBJ_TYPE='DATABASE LINK'
THEN
RAISE_APPLICATION_ERROR (-20000, 'Cannot create the ' || ORA_DICT_OBJ_TYPE ||' named ' || ORA_DICT_OBJ_NAME ||
' as requested by ' || ORA_DICT_OBJ_OWNER ||'联系管理员');
END IF;
END;
/
验证:
create public database link to_11 connect to scott identified by tiger using 'bylw';
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-20000: Cannot create the DATABASE LINK named TO_11 as requested by
??????????
ORA-06512: at line 4