Difference between revisions of "Script: Compile All Invalid Objects"

From Ittichai Chammavanijakul's Wiki
Jump to navigation Jump to search
Line 14: Line 14:
 
WHERE status <> 'VALID';
 
WHERE status <> 'VALID';
 
</pre>
 
</pre>
 +
 +
[[Category:Oracle_Scripts]]

Revision as of 05:26, 7 March 2011

-- ========================================================================================
-- 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';