As we all know, it is not easy to migrate a database from a higher version of Oracle to a lower version of oracle. If you directly use the SQL developer tool, you may not be able to complete the migration successfully (errors may occur more or less in the middle ).
Exp and IMP are applicable to Oracle data copy and backup of the same version. If Oracle data copies of different versions are used, exp is used for data backup from a higher version to a lower version, IMP may not be able to completely restore data. We can use the expdp and impdp tools provided by Oracle to help us implement them easily. We use the Oracle 11g migration database PMS to Oracle 10g as an example.
Export a backup from oracle11g:
expdp USERID='sys/sysadmin@orcl as sysdba' schemas=PMS dumpfile=pms_emp.dmp directory=DATA_PUMP_DIR version=10.2.0.1.0
Schemas is the source database solution, dumpfile is the backup file name, directory is the backup file storage directory, data_pump_dir is the default Oracle storage directory, the default is ORACLE_HOME \ admin \ orcl \ dpdump directory, the version is the target database version.
Import (Restore) backup from Oracle10g:
Restore to the same solution (schema = PMS ):
impdp userid='sys/sysadmin@orcl as sysdba' schemas=PMS directory=DATA_PUMP_DIR dumpfile=PMS_EMP.DMP logfile=export.logversion=10.2.0.1.0
Restore to different solutions (schema = pms_chris ):
impdp userid='sys/sysadmin@orcl as sysdba' directory=DATA_PUMP_DIR dumpfile=PMS_EMP.DMP logfile=export.logversion=10.2.0.1.0 REMAP_SCHEMA=PMS:PMS_CHRIS
Logfile is the log name generated when the backup is exported. The rest are explained in the same way.
In this way, database migration is generally complete in database restoration, and it is not prone to strange errors.