Want to post your scripts here in this blog ? Email it to snojha@gmail.com. You will be rewarded for your scripts if selected by our experts.

Wednesday, July 11, 2007

compile_invalid_objects.sql

-- -----------------------------------------------------------------------------------
-- File Name : compile_invalid_objects.sql
-- Author : Sachchida Ojha
-- Description : Compiles all invalid objects for user schema
-- Call Syntax : @compile_invalid_objects.sql
-- Last Modified: 04/28/2005
-- -----------------------------------------------------------------------------------

spool cinv.sql
select 'alter '||decode(object_type,'PACKAGE BODY','PACKAGE',object_type)
|| ' '||'.'|| object_name ||' compile' ||
decode(object_type, 'PACKAGE BODY', ' body;', ';')
from user_objects
where status = 'INVALID'
/
spool off
set termout on feedback on echo on
spool cinvobj.lis
@cinv.sql

column object_name format A30
column object_type format A20
select object_name, object_type, status
from user_objects
where status = 'INVALID'
/
spool off
set lines 80
prompt Spool file saved at cinvobj.lis
prompt Script file saved at cinv.sql
prompt

No comments: