views:

757

answers:

2

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.

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?

The user_triggers give all the triggers and tells if they are enable or not, but does not indicate if they are still valid.

+4  A: 
SELECT *
FROM   ALL_OBJECTS
WHERE  OBJECT_NAME = trigger_name
AND    OBJECT_TYPE = 'TRIGGER'
AND    STATUS <> 'VALID'
cagcowboy
Nice! Thanks a lot!
gizmo
Select * from user_objects where satus != 'VALID'
Brian
A: 

Have a look at SYS.OBJ$, specifically the STATUS column.

Mike McAllister