Backup and restore of data between oracle11G and oracle10G

As we all know, backing up a database from oracle11G according to the ordinary method cannot be restored in oracle10G. If you want to restore, you need to add the version number of oracle10G when backing up.

1. Backup data

1. Check the oracle version: select * from v$version;

2. Backup the database:

SQL format: expdp userid='admin/password as sysdba' schemas=name of data object dumpfile=name of backup data file.dmp logfile=name of backup data file.log version=oracle10G version

 

For example: the administrator is system, the password is manager, the data object is test, the name of the backup data file is test, and the version number of oracle10G is 10.2.0.1.0, then the sql I use is:

expdp userid='system/manager as sysdba' schemas=test dumpfile=test.dmp logfile=test.log version=10.2.0.1.0

The files backed up are in the Oracle installation directory by default, there are two: test.dmp and test.log

 

2. Restore data:

1. Place the two files test.dmp and test.log in the dpdump directory of oracle10G;

View the Oracle installation directory, you can learn by viewing the storage location of the data files and control files.

View the data file storage location: select name from v$datafile;

View the storage location of the control file: select name from v$controlfile;

 

2. Restore the database:

SQL form: impdp userid='administrator/password@oracle instance as
sysdba'directory=DATA_PUMP_DIR schemas=data object name dumpfile=backup data file name.dmp logfile=backup data file name.log version=oracle10G version number

Still using the above example, then my SQL is:

impdp userid='system/manager@orcl10g as sysdba'directory=DATA_PUMP_DIR schemas=test dumpfile=test.dmp logfile=test.log  version=10.2.0.1.0

 

When restoring, you may encounter the problem of "DATA_PUMP_DIR*** directory". You only need to set the default directory of DATA_PUMP_DIR, which is all under the dpdump of the oracle installation directory.

The SQL form is: create or replace directory DATA_PUMP_DIR as 'oracle installation\dpdump';

So the SQL used in the above example is: create or replace directory DATA_PUMP_DIR as 'D:\oracle\product\10.2.0\admin\orcl10g\dpdump';

 

After that, it should be able to restore successfully.

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326654390&siteId=291194637