oracle 触发器实现禁止在数据库中创建dblink ---通过触发器实现

前端之家收集整理的这篇文章主要介绍了oracle 触发器实现禁止在数据库中创建dblink ---通过触发器实现前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
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 原文链接:/oracle/207020.html

猜你在找的Oracle相关文章