如何检查触发器是否无效? [英] How to check if a trigger is invalid?

查看:207
本文介绍了如何检查触发器是否无效?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究具有一些晦涩的工具自动生成的移动表的数据库.顺便说一下,我们必须通过一些触发器来跟踪表中的信息更改.当然,例如,通过删除列或更改其类型,可能会发生表结构的某些更改破坏了某些触发器.

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'

这篇关于如何检查触发器是否无效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆