SELECT * FROM DBA_OBJECTS WHERE OWNER = 'OMIP700' AND STATUS = 'INVALID';

SELECT 'ALTER '||OBJECT_TYPE||' '||OWNER||'.'||OBJECT_NAME||' COMPILE;'
FROM DBA_OBJECTS 
WHERE OWNER = 'OMIP700' AND STATUS = 'INVALID'
AND OBJECT_TYPE IN ('VIEW','PROCEDURE','FUNCTION','PACKAGE','TYPE','MATERIALIAZED VIEW');

SELECT 'ALTER PACKAGE '||OWNER||'.'||OBJECT_NAME||' COMPILE BODY;'
FROM DBA_OBJECTS 
WHERE OWNER = 'OMIP700' AND STATUS = 'INVALID'
AND OBJECT_TYPE IN ('PACKAGE BODY');

SELECT 'CREATE OR REPLACE SYNONYM '||OWNER||'.'||SYNONYM_NAME||' FOR '||TABLE_OWNER||'.'||TABLE_NAME||';'
FROM DBA_SYNONYMS
WHERE OWNER = 'OMIP700'
AND SYNONYM_NAME IN (SELECT OBJECT_NAME FROM DBA_OBJECTS WHERE OWNER = 'OMIP700' AND STATUS = 'INVALID');
