Skip to content

Instantly share code, notes, and snippets.

@sandcastle
Created April 15, 2015 01:57
Show Gist options
  • Save sandcastle/5464c73dc073b8cf0a4e to your computer and use it in GitHub Desktop.
Save sandcastle/5464c73dc073b8cf0a4e to your computer and use it in GitHub Desktop.
Recompile all Oracle objects (requires access to dba_objects). If running as a user schema, you can use user_objects instead.
set heading off;
set feedback off;
set echo off;
Set lines 999;
spool run_invalid.sql
select 'ALTER ' || OBJECT_TYPE || ' ' || OWNER || '.' || OBJECT_NAME || ' COMPILE;'
from dba_objects
where status = 'INVALID'
and object_type in ('PACKAGE','FUNCTION','PROCEDURE');
spool off;
set heading on;
set feedback on;
set echo on;
@run_invalid.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment