Oracle 10g 11g RAC ASM RMAN Database Cloning to Different Server with Different File System


The Eucharistic Miracles of the World
Here is the Scenario:
We have 3 RMAN backup pieces from the source database (SOURCE)
Backup pieces which is already trasfered from ASM to file system :
mfmtiqi3_1_1, mhmtiqk5_1_1, SOURCE_cf_c-3981864101-20111207-00

SCN Number to be recovered which I got from Source database from the backup control file backup tag: 181169521

Target Database Name: (TARGET)

Steps to be done in TARGET Server.

  1. Create a initSOURCE.ora file

  1. Shutdown the TARGET database if already present and startup nomount the SOURCE database.
SQL> shutdown immediate;
startup nomount pfile=initSOURCE.ora

  1. Restore the control file from backupset.
RMAN> restore controlfile from '/u01/oracle/RMANBKUP/SOURCE_cf_c-3981864101-20111207-00';

  1. Update the initSOURCE.ora file with new control files details.
Controlfile=( +RECO/target/controlfile/current.515.767828343, +DATA/target/controlfile/current.438.767828343)

  1. Connect to sqlplus and rename the redo log files to new location
alter database rename file
alter database rename file '+DATA/source/onlinelog/group_1.285.752872271' to '+DATA/target/onlinelog/group_1.285.752872271';
alter database rename file '+DATA/source/onlinelog/group_2.296.752872277' to '+DATA/target/onlinelog/group_2.296.752872277';
alter database rename file '+DATA/source/onlinelog/group_3.295.752872279' to '+DATA/target/onlinelog/group_3.295.752872279';
alter database rename file '+RECO/source/onlinelog/group_1.1877.764270427' to '+RECO/target/onlinelog/group_1.1877.764270427';
alter database rename file '+RECO/source/onlinelog/group_2.4749.764270429' to '+RECO/target/onlinelog/group_2.4749.764270429';
alter database rename file '+RECO/source/onlinelog/group_3.4743.764270433' to '+RECO/target/onlinelog/group_3.4743.764270433';

  1. Connect to RAMN and catalog the backup pieces.
catalog backuppiece '/u01/oracle/RMANBKUP/mfmtiqi3_1_1';
catalog backuppiece '/u01/oracle/RMANBKUP/mhmtiqk5_1_1';

  1. Connect to RMAN and run the following script. The green colored items needs to be modified as per your standard
run {
set until scn  181169521;
set newname for datafile 1 to '+DATA/target/datafile/system.289.752871853';
set newname for datafile 2 to '+DATA/target/datafile/sysaux.306.752871879';
set newname for datafile 3 to '+DATA/target/datafile/undotbs1.307.752871903';
set newname for datafile 4 to '+DATA/target/datafile/users.287.752871931';
set newname for datafile 5 to '+DATA/target/datafile/data.303.752871809';
set newname for datafile 6 to '+DATA/target/datafile/undotbs2.290.752873397';
restore database;
switch datafile all;
recover database;
alter database open resetlogs;
Now your database cloning is completed. You have to rename the control file.

  1. Rename the database. You can use following methods.

  1. In RAC most of the cases you have to rename the datafiles as it restore the datafiles to original location
a.  Get the datafile list from the database using
Select file_name from dba_data_files; query
b.  Shutdown the database and mount it
c.  Connect to RMAN and use following command to files from one location to another
RMAN> copy datafile '+DATA/target/datafile/system.289.752871853' to '+DATA';



Post a comment


Oracle (575) General (60) Unix (47) Blog (23) Script (12) OCI (3) SQL* Loader (3) Software (1) Copyright 2011-21 All Rights Reserved | Site Map | Contact | Disclaimer