Tuesday, December 19, 2017

Fix Invalid Objects on AWS RDS

--
-- Fix Invalid Objects on AWS RDS where you do not 
-- have access to utlrp.sql.
--
 
SET LINES 180
SET ECHO OFF
SET HEA OFF
SET FEEDBACK OFF
 
SPOOL /tmp/fixinvalid.sql
select distinct('exec SYS.UTL_RECOMP.RECOMP_SERIAL('''||owner||''');') 
from dba_objects WHERE status = 'INVALID'
/
SPOOL OFF
 
SET FEEDBACK ON
SET ECHO ON
@/tmp/fixinvalid.sql