a project: data that needs to be migrated from the old server to the new server and exported with exp
IMP encountered the following error message when importing EXP export backup:
IMP-00017: following statement failed with ORACLE error 2298: "ALTER TABLE "RESERVATION" ENABLE CONSTRAINT "RESERVATION_FK31252591893468""IMP-00003: ORACLE error 2298 encounteredORA-02298: cannot validate (RESERVATION.RESERVATION_FK31252591893468) - parent keys not foundImport terminated successfully with warnings.
Causes of errors and solutions:
The above reasons may be in the export time a table has been exported, but his foreign key off the contact data changes, resulting in inconsistencies, so error. EXP does not guarantee the integrity of the transaction. If you export the main table. Then someone adds a record to the main table, and then adds a record to the child table, commits.
Can not identify the above is said to be correct, should also occur, but after a lot of information and found that it should be exp export a parameter is missing. So the workaround is to add this parameter to the script that exports the backup consistent=y default to No. To maintain a consistent role.
$ exp rh/124 file=/home/oracle/rh201804260920.dmp owner=rh grants=no consistent=y
The grants parameter indicates that no authorization is to be exported on the database object when exporting (no does not export)
In the import there will be no error:
$ imp rh/jkj file=/home/oracle/rh201804260920.dmp ignore=y full=y
Oracle IMP Import Errors imp-00003:oracle error 2298