Wednesday, 26 October 2016

impdp: ORA-39083: Object type TYPE failed to create with error: ORA-02304: invalid object identifier literal

This error happened when expdp and impdp a schema to a new one in the same database.

impdp directory=EXP_DIR dumpfile=XXXX_1.dmp logfile=imp_XXXX_1_imp.log REMAP_SCHEMA=XXXX:BBBBB 

Failing sql is:-

CREATE TYPE "XXXXXX"."MIGR_XXXXXX"   OID 'C3A0F356E96E60D7E04400144F3BFA98' AS OBJECT
       (LABEL           VARCHAR2(50),
            SCHEMA_SUM      NUMBER,
        TABLE_SUM       NUMBER
        );

ORA-39083: Object type TYPE failed to create with error:
ORA-02304: invalid object identifier literal

Failing sql is:

CREATE TYPE "XXXXX"."MIGR_XXXXXX"  OID 'C3A0F356E97D60D7E04400144F3BFA98' AS OBJECT ( nameConvMapId NUMBER , nameConvCntr NUMBER )


Cause:  OID should be unique in a database. the OID in the impdp create statemene was used by old schema.

solution:-

1. Remove the OID from failing sql and rerun it manually.

2. impdp again with parameter transform=OID:n

impdp directory=EXP_DIR dumpfile=XXXX_1.dmp logfile=imp_XXXX_1_imp.log REMAP_SCHEMA=XXXX:BBBBB TRANSFORM=oid:n

No comments:

Post a Comment