While during impdp,I have seen the error ORA-39083 & ORA-02270 in impdp logfile.
ERROR:
ORA-02270: no matching unique or primary key for this column-list
Failing sql is:
ALTER TABLE "USER"."SMARTDB" ADD CONSTRAINT "PRLD_PRLM_FK" FOREIGN KEY ("PRLD_PRLM_FK") REFERENCES "PI OOL"."SMARTDB" ("PRLM_PK") DISABLE
ORA-39083: Object type REF_CONSTRAINT failed to create with error:
Workaround:
Compare the source and target environment tables,
Step 1: Check the tables which are having primary key disabled
SQL> select owner||''||constraint_name||''||constraint_type||''||status from dba_constraints where table_name='SMARTDB';
OWNER||''||CONSTRAINT_NAME||''||CONSTRAINT_TYPE||''||STATUS
------------------------------------------------------------------------
USER PRLM_PK P DISABLED
USER SYS_C0015976 C DISABLED
USER SYS_C0015975 C DISABLED
USER SYS_C0015974 C DISABLED
USER SYS_C0015973 C DISABLED
USER SYS_C0015972 C DISABLED
6 rows selected.
SQL> select owner||''||constraint_name||''||constraint_type||''||status from dba_constraints where table_name='SMARTDB';
OWNER||''||CONSTRAINT_NAME||''||CONSTRAINT_TYPE||''||STATUS
------------------------------------------------------------------------
USER PLM_PK P DISABLED
USER SYS_C0015986 C DISABLED
USER SYS_C0015985 C DISABLED
USER SYS_C0015984 C DISABLED
USER SYS_C0015983 C DISABLED
USER PLM_FK R DISABLED
6 rows selected.
Step 2:Enable the primary keys on SOURCE database
SQL> ALTER TABLE USER.SMARTDB enable CONSTRAINT PRLM_PK;
Table altered.
SQL> ALTER TABLE USER.SMARTDB enable CONSTRAINT PLM_PK;
Table altered.
SQL> select owner||''||constraint_name||''||constraint_type||''||status from dba_constraints where table_name='SMARTDB';
OWNER||''||CONSTRAINT_NAME||''||CONSTRAINT_TYPE||''||STATUS
------------------------------------------------------------------------
USER PRLM_PK P ENABLED
USER SYS_C0015976 C DISABLED
USER SYS_C0015975 C DISABLED
USER SYS_C0015974 C DISABLED
USER SYS_C0015973 C DISABLED
USER SYS_C0015972 C DISABLED
6 rows selected.
Step 3: Now do the expdp,copy the dump file and impdp in target database.
Remember to disable the primary keys at both Source and Target side.
In the final step,copy the new dump file and import into target database.
ERROR:
ORA-02270: no matching unique or primary key for this column-list
Failing sql is:
ALTER TABLE "USER"."SMARTDB" ADD CONSTRAINT "PRLD_PRLM_FK" FOREIGN KEY ("PRLD_PRLM_FK") REFERENCES "PI OOL"."SMARTDB" ("PRLM_PK") DISABLE
ORA-39083: Object type REF_CONSTRAINT failed to create with error:
Workaround:
Compare the source and target environment tables,
Step 1: Check the tables which are having primary key disabled
SQL> select owner||''||constraint_name||''||constraint_type||''||status from dba_constraints where table_name='SMARTDB';
OWNER||''||CONSTRAINT_NAME||''||CONSTRAINT_TYPE||''||STATUS
------------------------------------------------------------------------
USER PRLM_PK P DISABLED
USER SYS_C0015976 C DISABLED
USER SYS_C0015975 C DISABLED
USER SYS_C0015974 C DISABLED
USER SYS_C0015973 C DISABLED
USER SYS_C0015972 C DISABLED
6 rows selected.
SQL> select owner||''||constraint_name||''||constraint_type||''||status from dba_constraints where table_name='SMARTDB';
OWNER||''||CONSTRAINT_NAME||''||CONSTRAINT_TYPE||''||STATUS
------------------------------------------------------------------------
USER PLM_PK P DISABLED
USER SYS_C0015986 C DISABLED
USER SYS_C0015985 C DISABLED
USER SYS_C0015984 C DISABLED
USER SYS_C0015983 C DISABLED
USER PLM_FK R DISABLED
6 rows selected.
Step 2:Enable the primary keys on SOURCE database
SQL> ALTER TABLE USER.SMARTDB enable CONSTRAINT PRLM_PK;
Table altered.
SQL> ALTER TABLE USER.SMARTDB enable CONSTRAINT PLM_PK;
Table altered.
SQL> select owner||''||constraint_name||''||constraint_type||''||status from dba_constraints where table_name='SMARTDB';
OWNER||''||CONSTRAINT_NAME||''||CONSTRAINT_TYPE||''||STATUS
------------------------------------------------------------------------
USER PRLM_PK P ENABLED
USER SYS_C0015976 C DISABLED
USER SYS_C0015975 C DISABLED
USER SYS_C0015974 C DISABLED
USER SYS_C0015973 C DISABLED
USER SYS_C0015972 C DISABLED
6 rows selected.
Step 3: Now do the expdp,copy the dump file and impdp in target database.
Remember to disable the primary keys at both Source and Target side.
In the final step,copy the new dump file and import into target database.