select 'alter package '||object_name||' compile body;'
from user_objects
where object_type = 'PACKAGE BODY'
union
select 'alter package '||object_name||' compile;'
from user_objects
where object_type = 'PACKAGE'
union
select 'alter procedure '||object_name||' compile;'
from user_objects
where object_type = 'PROCEDURE'
union
select 'alter function '||object_name||' compile;'
from user_objects
where object_type = 'FUNCTION';
You can compile all objects that are invalid with this script:
set heading off;
set feedback on;
set pages 10000;
spool &&spoolfile
select 'alter '||object_type, object_name
||' compile;'
from user_objects
where status = 'INVALID'
and object_type != 'PACKAGE BODY'
union
select 'alter package '||NULL, object_name
||' compile body;'
from user_objects
where status = 'INVALID'
and object_type = 'PACKAGE BODY';
Bookmarks