Professional Documents
Culture Documents
White Paper
By Ritesh Rajkaran Chhajer Mukesh Burgupalli Ashwin Nellore Arpan Kumar Shrivastava SE&O DBA Team
1. Purpose This document explains the steps to restore and recover a RMAN backup to a different host. This document can be used to test the recovery of an existing RMAN backup as well as for the real-time recovery 2. Steps to restore and recover the database to different host The following recovery test will restore and recover the backup of database gqdna01s on gq1stgdnadb-001.data.gq1 to ac4-stgsstrdb-001.ysm.ac4. This test assumes the following: We have the RMAN backup, init.ora file available on the new machine. So we need to restore controlfile and then the datafiles. Steps to restore the spfile is also covered. The backup is made available on the new machine by mounting it in the same name as the target database. If it is mounted with a different name, you will have to create a symlink to that with the same name as on the target database. The datafile naming convention in the target database and the new host is different. Hence, the 'set newname' clause to rename datafiles is used. Source Host: gq1-stgdnadb-001.data.gq1 (ASM) Target Host: ac4-stgsstrdb-001.ysm.ac4 (Non-ASM) Existing RMAN Backup Location on source: /mnt/dna_rman1_nonprod/dev/full_lvl0 Pre-requisites: 1 .Copy the backup to be made available on the destination host under the same directory structure. 2. Edit /etc/fstab on the destination (ac4-stgsstrdb-001.ysm.ac4): ac4-stgiraud2nfs-001.adx.ac4.yahoo.com:/vol/RM_DAT /mnt/dna_rman1_nonprod nfs nolock,rsize=32768,wsize=32768,hard,nointr,rw,bg,vers=3,tcp,actimeo=0,timeo=600 0 0 # mkdir -p /mnt/dna_rman1_nonprod/dev # chmod 755 /mnt/dna_rman1_nonprod/dev # chown oracle:dba /mnt/dna_rman1_nonprod/dev Once the backup is available on the destination, follow the steps: 1) Get the DBID of the target database (gq1-stgdnadb-001.data.gq1) either from querying the source database, if available source /oracle/.zshrc select dbid from v$database; OR
ls -ltr /u01/oradata/gqdna01s/control01.ctl will be the control file for the new database. 7) RMAN> sql 'alter database mount'; 8) RMAN> list backup of database; 9) Datafile location settings: Case 1: Source and destination hosts have different directory structure, for eg ASM to nonASM spool restore.rman select 'set newname for datafile '||file#||' to '''||replace(name,'x','y')||''';' from v$datafile; spool off --Modify restore.rman to look like this: run { #For all datafiles: Set newname for datafile '+DATA/prod/system01.dbf' to '/u01/oradata/gqdna01s/system01.dbf'; ... .... #For all tempfiles: set newname for tempfile 1 to '/u01/oradata/gqdna01s/tempfile'; ..... restore database; switch datafile all; switch tempfile all; recover database } Run: RMAN>@restore.rman Check if you have a proper backup of gqdna01s.