Dynamicall y create a SQL script to recompile all INVALID objects
set feedback off
set verify off
set echo off
set pagesize 0
set heading off
spool compile_invalid_objects.sql
select 'alter ' ||
decode(object_type, 'PACKAGE BODY', 'package', object_type) ||
' ' ||
object_name||
' compile' ||
decode(object_type, 'PACKAGE BODY', ' body;', ';')
from dba_objects
where status = 'INVALID'
/
spool off
set feedback on
set verify on
set heading on
set pagesize 40
@compile_invalid_objects
set verify off
set echo off
set pagesize 0
set heading off
spool compile_invalid_objects.sql
select 'alter ' ||
decode(object_type, 'PACKAGE BODY', 'package', object_type) ||
' ' ||
object_name||
' compile' ||
decode(object_type, 'PACKAGE BODY', ' body;', ';')
from dba_objects
where status = 'INVALID'
/
spool off
set feedback on
set verify on
set heading on
set pagesize 40
@compile_invalid_objects