I promised it long time after receiving to many requests I decided to share it with you today. Many people usually prefer to work with mysql instead of oracle (no debate !!!) because with mysql they can easily export and import their database. But Oracle that so inflexible ? No. As you will see you can easily export (backup) and recover (import) an Oracle database between two hosts (I am using Wxp) using the RMAN power.
Note:
H1: current host.
H2: new host.
Note: Sometimes you have to backup database plus archivelog in order to avoid ORA-19698.
I hope from now on you will have fun with it. You feedback is always welcome.
Note:
H1: current host.
H2: new host.
- Backup H1 using RMAN.
- in host H1:
Make sure H1 is in archivelog mode and rman autobackup on...
rman> backup database; - transfer the backup of H1 to host H2 (flash_recovery_area = C:\oracle\product\10.2.0\flash_recovery_area)
- Determine the DBID of host H1
- Now on host H2, make sure it has been shutdown.
- -set the oracle_sid same as for H1
- -rman target /
- -set the oracle_sid same as for H1
- -rman target /
- rman> set dbid dbid_of_H1
- rman> startup nomount
- rman> restore controlfile from autobackup;
- rman> alter database mount;
- list the backup and take the SCN (scn_nb) number...
rman> list backup - restore and recover
rman> run
{
set until scn scn_nb
restore database;
switch datafile all;
recover database;
};
if receive ORA-19698 telling the dbid is different...
Solution: replace the redologs ( located inside oradata) file in H2 wiht the one in H1
Then run run{...} again - open the database resetlog option.
rman> alter database open resetlogs;
Note: Sometimes you have to backup database plus archivelog in order to avoid ORA-19698.
I hope from now on you will have fun with it. You feedback is always welcome.
No comments:
Post a Comment