DataPump Import Of Object Types Fails With Errors ORA-39083 ORA-2304
操作环境:expdp user 导出,导入同库 impdp other user
expdp system/oracle DIRECTORY=dump DUMPFILE=expdp_u1.dmp LOGFILE=expdp_u1.log SCHEMAS=u1
impdp system/oracle DIRECTORY=dump DUMPFILE=expdp_u1.dmp LOGFILE=impdp_u1.log REMAP_SCHEMA=u1:u2
错误信息:
CREATE TYPE "U2"."MY_COLTYPE" OID '0EA263913ADD0054E0530A7C54FB799B' AS OBJECT (nr NUMBER, txt VARCHAR2(10))
ORA-39083: Object type TYPE failed to create with error:
ORA-02304: invalid object identifier literal
解决方法:
impdp system/oracle DIRECTORY=dump DUMPFILE=expdp_u1.dmp LOGFILE=impdp_u1.log REMAP_SCHEMA=u1:u2
TRANSFORM=oid:n
注:you can use the Import DataPump parameter TRANSFORM which enables you to alter object creation DDL for the types. The value N (= No) for the transform name OID implies that a new OID is assigned.
问题原因:
The object types MY_COLTYPE and MY_TABTYPE already exist in the source schema U1. When the types are exported, we also export the object_identifier (OID) of the types. Within the current archictecture, the object-identifier needs to be unique in the database.
During import (into the same database), we try to create the same object types in the U2 schema. As the OID of the types already exists in the source schema U1, the types cannot be created in the target schema U2. Import will fail due to:
ORA-02304: invalid object identifier literal
本文源于:DataPump Import Of Object Types Fails With Errors ORA-39083 ORA-2304 Or ORA-39117 ORA-39779 (文档 ID 351519.1)