Invalid Objects in Database:
============================
set lines 130;
col object_name for a35
col object_type for a15
col status for a8
select object_name, object_type, owner from dba_objects where status='INVALID' and
owner like upper('%&owner%');
-----------------------------------------------------------------------------------
-------------
Compiling Package, Function, Procedure, Views:
=================================================
Spool run_invalid.sql
select
'ALTER ' || OBJECT_TYPE || ' ' ||
OWNER || '.' || OBJECT_NAME || ' COMPILE;'
from
dba_objects
where
status = 'INVALID' and
owner = upper('&owner') and
object_type in ('PACKAGE','FUNCTION','PROCEDURE','VIEW')
/
spool off
-----------------------------------------------------------------------------------
-----------
Compiling Package Body
=======================
select
'ALTER ' || OBJECT_TYPE || ' ' ||
OWNER || '.' || OBJECT_NAME || ' COMPILE BODY;'
from
dba_objects
where
status = 'INVALID' and
owner = upper('&owner') and
object_type in ('PACKAGE BODY')
/