Oracle/SQL:检查触发器是否启用/禁用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/49557423/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Oracle/SQL: Check If Trigger Enabled/Disabled
提问by Rushikumar
How do you check if a specific trigger is enabled or disabled in Oracle/SQL?
您如何检查在 Oracle/SQL 中是否启用或禁用了特定触发器?
The following specifies if my trigger is valid or not -- but not enabled or disabled
以下指定我的触发器是否有效 - 但未启用或禁用
SELECT *
FROM ALL_OBJECTS
WHERE OBJECT_TYPE = 'TRIGGER' AND OBJECT_NAME = 'the_trigger_name';
My Oracle Database version: 12c - Enterprise Edition v12.1.0.2.0 - 64bit
我的 Oracle 数据库版本:12c - 企业版 v12.1.0.2.0 - 64 位
I have checked StackOverflow and came across the following posts, but didn't find an answer specific to Oracle/SQL:
我检查了 StackOverflow 并遇到以下帖子,但没有找到特定于 Oracle/SQL 的答案:
回答by Rushikumar
user_triggers
is the table where all triggers created, specific to the schema, are located.
user_triggers
是所创建的所有触发器(特定于架构)所在的表。
So,
所以,
SELECT STATUS FROM USER_TRIGGERS WHERE TRIGGER_NAME = 'the_trigger_name';
will fetch the status of either ENABLED
or DISABLED
.
将获取ENABLED
或的状态DISABLED
。
Also, to fetch ALL triggers and their statuses--
此外,要获取所有触发器及其状态--
SELECT TRIGGER_NAME, STATUS FROM USER_TRIGGERS;