问题描述
我正在研究具有一些晦涩的工具自动生成的移动表的数据库.顺便说一下,我们必须通过一些触发器来跟踪表中的信息更改.当然,例如,通过删除列或更改其类型,可能会发生表结构的某些更改破坏了某些触发器.
I'm working on databases that have moving tables auto-generated by some obscure tools. By the way, we have to track information changes in the table via some triggers. And, of course, it occurs that some changes in the table structure broke some triggers, by removing a column or changing its type, for example.
因此,问题是:为了向支持团队发送报告,是否有一种方法可以查询Oracle元数据以检查某些触发器是否中断?
So, the question is: Is there a way to query the Oracle metadata to check is some triggers are broken, in order to send a report to the support team?
user_triggers提供所有触发器,并告知它们是否已启用,但不指示它们是否仍然有效.
The user_triggers give all the triggers and tells if they are enable or not, but does not indicate if they are still valid.
推荐答案
SELECT *
FROM ALL_OBJECTS
WHERE OBJECT_NAME = trigger_name
AND OBJECT_TYPE = 'TRIGGER'
AND STATUS <> 'VALID'
这篇关于如何检查触发器是否无效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!