Saturday, September 08, 2007

Restore a RMAN backup from disk to a new host with different pathname

We have a requirement to restore an 8 months old GENP RMAN backup from tape. In order to be familiar with the procedure, I tested restoring a recent GENP RMAN backup from disk to a new host with different pathname. The steps are outlined as follows:

 

 

1. Copy init.ora from old host to new host

   edit *dump, controlfile

 

2. Copy current controlfile to the new host

 

 

3. Start the instance and mount the database

    startup mount

 

4. Use rman without catalog

   rman target / nocatalog

 

5. Issue following command:

 

run {

     set until time '08-SEP-2007 05:20:02'; 

     allocate channel ch1 type disk;

     allocate channel ch2 type disk;

     set newname for datafile 1          to '/ora01/orabkup/GEN3S/GENP/genp_system01.dbf';

     set newname for datafile 2          to '/ora01/orabkup/GEN3S/GENP/genp_tools01.dbf';

     ( ...  DS: omit 3 - 50)

 

     set newname for datafile 51         to '/ora01/orabkup/GEN3S/GENP/gen_indx_12.dbf';

     set newname for datafile 52         to '/ora01/orabkup/GEN3S/GENP/gen_data_16.dbf';

 

     restore database;

     switch datafile all;  # points the control file to the renamed datafiles

     recover database;

     alter database open resetlogs;

 

 

6.  Failure at 'alter database open resetlogs'

...

 

RMAN-08515: archivelog filename=/ora01/orabkup/GEN3S/GENP1/arch_GENP_000111585.arc thread=1 sequence=111585

RMAN-08515: archivelog filename=/ora01/orabkup/GEN3S/GENP1/arch_GENP_000111586.arc thread=1 sequence=111586

RMAN-08515: archivelog filename=/ora01/orabkup/GEN3S/GENP1/arch_GENP_000111587.arc thread=1 sequence=111587

RMAN-08515: archivelog filename=/ora01/orabkup/GEN3S/GENP1/arch_GENP_000111588.arc thread=1 sequence=111588

RMAN-08055: media recovery complete

 

RMAN-03022: compiling command: alter db

RMAN-03026: error recovery releasing channel resources

RMAN-08031: released channel: ch1

RMAN-08031: released channel: ch2

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure during compilation of command

RMAN-03013: command type: alter db

RMAN-06003: ORACLE error from target database: ORA-00344: unable to re-create online log '/ora01/oradata/GENP/genp_redo01a.log'

ORA-27040: skgfrcre: create error, unable to create file

SVR4 Error: 2: No such file or directory

RMAN-06097: text of failing SQL statement: alter database open resetlogs

RMAN-06099: error occurred in source file: krmk.pc, line: 22291

 

RMAN>

RMAN> **end-of-file**

 

 

7. Move the redo log file

   Issue the following statements, after that  database is opened successfully with resetlogs

 

alter database rename file '/ora01/oradata/GENP/genp_redo01a.log' to '/ora01/orabkup/GEN3S/GENP1/genp_redo01a.log';

alter database rename file '/ora01/oradata/GENP/genp_redo02a.log' to '/ora01/orabkup/GEN3S/GENP1/genp_redo02a.log';

alter database rename file '/ora01/oradata/GENP/genp_redo03a.log' to '/ora01/orabkup/GEN3S/GENP1/genp_redo03a.log';

alter database rename file '/ora01/oradata/GENP/genp_redo04a.log' to '/ora01/orabkup/GEN3S/GENP1/genp_redo04a.log';

alter database rename file '/ora01/oradata/GENP/genp_redo05a.log' to '/ora01/orabkup/GEN3S/GENP1/genp_redo05a.log';

alter database rename file '/ora01/oradata/GENP/genp_redo06a.log' to '/ora01/orabkup/GEN3S/GENP1/genp_redo06a.log';

alter database rename file '/ora02/oradata/GENP/genp_redo01b.log' to '/ora01/orabkup/GEN3S/GENP/genp_redo01b.log';

alter database rename file '/ora02/oradata/GENP/genp_redo02b.log' to '/ora01/orabkup/GEN3S/GENP/genp_redo02b.log';

alter database rename file '/ora02/oradata/GENP/genp_redo03b.log' to '/ora01/orabkup/GEN3S/GENP/genp_redo03b.log';

alter database rename file '/ora02/oradata/GENP/genp_redo04b.log' to '/ora01/orabkup/GEN3S/GENP/genp_redo04b.log';

alter database rename file '/ora02/oradata/GENP/genp_redo05b.log' to '/ora01/orabkup/GEN3S/GENP/genp_redo05b.log';

alter database rename file '/ora02/oradata/GENP/genp_redo06b.log' to '/ora01/orabkup/GEN3S/GENP/genp_redo06b.log';

 

 

 

Note: RMAN backup files have been already ftp'ed to the new host

No comments: