调试Oracle DDL触发器

发布于 2025-01-24 23:19:46 字数 1349 浏览 3 评论 0原文

无法理解为什么Oracle没有发射任何DDL触发器。

>SELECT * FROM V$VERSION 
Oracle Database 18c Express Edition Release 18.0.0.0.0 - Production

示例来自 https://docs.oracle.com/en/database/oracle/oracle-database/21/lnpls/plsql-triggers.html-trigggers.html#guid-6cf3a208-08-0be7-0be7-0be7-0be7-0be7-45ff-928f-928f-928c-a75555555555555555555555555555550

STUDENT> CREATE OR REPLACE TRIGGER drop_trigger
           BEFORE DROP ON student.SCHEMA
           BEGIN
             RAISE_APPLICATION_ERROR (
               num => -20000,
               msg => 'Cannot drop object');
           END;
[2022-04-29 11:28:09] completed in 293 ms
STUDENT> create table  tbl1 (a integer)
[2022-04-29 11:28:16] completed in 124 ms
STUDENT> drop table tbl1
[2022-04-29 11:28:17] completed in 155 ms

用户和模式 - 两个“学生”;

与DDL-Logging示例完全相同,来自

after ddl on schema 
after ddl on student.schema 
after ddl on database   -- created from name of SYS user

user_errorsall_errors没有与问题相关的消息

吗?

Can't understand why Oracle did not fire any DDL trigger.

>SELECT * FROM V$VERSION 
Oracle Database 18c Express Edition Release 18.0.0.0.0 - Production

Example from https://docs.oracle.com/en/database/oracle/oracle-database/21/lnpls/plsql-triggers.html#GUID-6CF3A208-0BE7-45FF-928C-A755526933D0

STUDENT> CREATE OR REPLACE TRIGGER drop_trigger
           BEFORE DROP ON student.SCHEMA
           BEGIN
             RAISE_APPLICATION_ERROR (
               num => -20000,
               msg => 'Cannot drop object');
           END;
[2022-04-29 11:28:09] completed in 293 ms
STUDENT> create table  tbl1 (a integer)
[2022-04-29 11:28:16] completed in 124 ms
STUDENT> drop table tbl1
[2022-04-29 11:28:17] completed in 155 ms

user and schema - both "Student";

Absolutely the same with DDL-logging example from http://www.dba-oracle.com/sf_ora_04098_trigger_string_string_is_invalid_and_failed_re_validation.htm - no any results for

after ddl on schema 
after ddl on student.schema 
after ddl on database   -- created from name of SYS user

All triggers a visible and shown as ENABLED at all_triggers .
There no problem-related message at user_errors or all_errors

Any suggestion?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文