Sei sulla pagina 1di 2

Restore and Recovery of the Database on a New Host

Question: I want to use RMAN to copy a database to a different server, in a different disk directory. Can I use
RMAN to restore a database to another server?

Answer: by Sorabh Harit: Applies to: Oracle Server - Enterprise Edition - Version: 10.2.0.0.0

The goal is restoring a database using RMAN on a different node with different backup directory structures and
different database directory structures .

* You have a database backed up on NODE 1.


* You need to restore the database on NODE 2.
* The directory structure is different on NODE 2.
* You need to put the backups in a new directory structure in NODE 2, unlike as they were in NODE 1.
* You need to restore the database files into a new directory structure in NODE 2, unlike as they were in
NODE 1.

Solution

Below is the procedure with an example of using RMAN to copy a database to another directory:

1. Connect to the target database using rman and backup the database ---> NODE
1
C:> rman target sys/system
RMAN>backup database plus archivelog;

RMAN>LIST BACKUP OF DATABASE;

2. Move the following files to the NODE 2 :


+ The database backup pieces
+ Controlfile backup piece
+ The parameter file i.e init.ora file
3. Restore the controlfile from the backup piece.

RMAN> restore controlfile from '/u01/oracle/product/ora10g/dbs/c-3932056136-20070213-02';


Starting restore at 13-FEB-07
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=155 devtype=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete,
elapsed time: 00:00:02
output filename=/u01/oracle/product/oradata/ora10g/cntrl/control01.ctl
Finished restore at 13-FEB-07
4. Mount the database.

RMAN> alter database mount ;


5. Now catalog the backup pieces that were shipped from NODE 1.

RMAN> catalog backuppiece


6. '/home/oracle/test/backup/o1_mf_annnn_TAG20070213T002925_2x21m6ty_.bkp';
7. Rename the Redologfiles,so that they can be created in new locations when opened the
database is opened in resetlogs.
8. restoring Datafiles from the backup
6. RMAN> restore database;

now database needs to be recovered with Archived redolog files


RMAN> recover database;
after recovering database you need to startup the database with resetlogs option
RMAN> alter database open resetlogs;

database opened

RMAN> exit

Potrebbero piacerti anche