Impdp issues...

If you ever end up with lots of invalid synonyms after impdp - quick sql to sort it out.

Just a note as no doubt this will happen again and I won't remember :(


SQL> select owner, object_type, count(object_type) from dba_objects where status != 'VALID' group by owner, object_type order by 1,2
2 /

OWNER OBJECT_TYPE COUNT(OBJECT_TYPE)
----- ----------- ----------
CON29GIS2 SYNONYM 129

SQL> select 'alter synonym '||owner||'.'||object_name||' compile; ' from dba_objects where status='INVALID' and object_type='SYNONYM' and owner='CON29GIS2' order by 1
2 /

'ALTERSYNONYM'||OWNER||'.'||OBJECT_NAME||'COMPILE;'
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
alter synonym CON29GIS2.ANSWERS compile;
alter synonym CON29GIS2.ANSWER_COMBINATIONS compile;
alter synonym CON29GIS2.API_CALLED compile;
....etc
 
 
JAVA CLASS and JAVA SOURCE Objects Become Invalid After Impdp. (Doc ID 1462622.1)
 

SQL> select owner, object_type, count(object_type) from dba_objects where status != 'VALID' group by owner, object_type order by 1,2
2 /


OWNER OBJECT_TYPE COUNT(OBJECT_TYPE)
----- ----------- ----------
CON29R2 JAVA CLASS 76

SQL> select 'ALTER JAVA CLASS CON29R2."'||OBJECT_NAME||'" resolve;' from dba_objects where status !='VALID' and object_type = 'JAVA CLASS'
  2  /

'ALTERJAVACLASSCON29R2."'||OBJECT_NAME||'"RESOLVE;'
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
ALTER JAVA CLASS CON29R2."SFSexportBlob" resolve;
ALTER JAVA CLASS CON29R2."SFSLiveLinkAPI" resolve;
ALTER JAVA CLASS CON29R2."com/opentext/api/LAPI_ATTRIBUTES" resolve;
ALTER JAVA CLASS CON29R2."com/opentext/api/LAPI_ATTRSERVER" resolve;
ALTER JAVA CLASS CON29R2."com/opentext/api/LAPI_DOCUMENTS" resolve;

Alter user as approp.



No comments:

Post a Comment