Script: Compile All Invalid Objects

From Ittichai Chammavanijakul's Wiki
Revision as of 05:26, 7 March 2011 by Ittichai (talk | contribs)
Jump to navigation Jump to search
-- ========================================================================================
-- Compile all Invalid objects
--       PACKAGE BODY:
--			alter package owner.package_body_name compile BODY;
--
--	   All Others:
--			alter object_type owner.object_name compile;
-- ========================================================================================
SELECT 'alter ' || decode(object_type,'PACKAGE BODY','PACKAGE',object_type) 
|| ' ' || owner || '.' || object_name || ' compile ' 
|| decode(object_type,'PACKAGE BODY','body','') || ';'
FROM dba_objects
WHERE status <> 'VALID';