Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: invalid procedure/trigger
To check for invalid objects:
select object_type, owner, object_name
from dba_objects
where object_type in ('PACKAGE','PACKAGE BODY','PROCEDURE','FUNCTION')
AND OWNER IN ('MyOwner1','MyOwner2')
and status = 'INVALID'
order by decode(object_type,'PACKAGE',0,from dba_objects
'PACKAGE BODY',1,
'FUNCTION', 2,
'PROCEDURE',3,
'TRIGGER',4
5), owner, object_name; To create sql to recompile the invalid ones: select 'alter ' || decode(object_type,'PACKAGE BODY','package',lower(object_type)) || ' ' || owner||'.'||object_name || ' compile ' || decode(object_type,'PACKAGE BODY','body;',';')
order by decode(object_type,'PACKAGE',0,
'PACKAGE BODY',1,
'FUNCTION', 2,
'PROCEDURE',3,
'TRIGGER',4
5), owner, object_name; Djordje ----- Original Message -----
Dear all DBAs,
Is there any way to check whether the procedures or triggers is valid? and if it's not valid, recompile it automatically. Some of the DBAs here always forgot to check procedures/triggers after modify table.
Thanks in advance.
-- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Djordje Jankovic INET: djordjej_at_rogers.com Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Wed Jan 08 2003 - 22:33:52 CST
![]() |
![]() |