Duplicating a Database

11gR2 RAC (ASM) to Single Instance (NON-ASM) Cloning.

duplicate database to dupdb from active database nofilenamecheck;

RMAN Duplicate from Active Database – ASM to non-ASM

run
{
         SET NEWNAME FOR TEMPFILE 1 TO '/u01/oradata/ora11gr2/datafiles/temp01.dbf';
         DUPLICATE TARGET DATABASE TO "ora11gr2"
         FROM ACTIVE DATABASE
         DB_FILE_NAME_CONVERT '+DATA1/ora11gr2/datafile/','/u01/oradata/ora11gr2/datafiles/'
         SPFILE
         SET LOG_FILE_NAME_CONVERT '+DATA1/ora11gr2/onlinelog/','/u01/oradata/ora11gr2/redologs/'
         SET AUDIT_FILE_DEST '/u01/app/ora11gr2/admin/ora11gr2/adump'
         SET CONTROL_FILES '/u01/oradata/ora11gr2/datafiles/control01.ctl'
         SET DB_RECOVERY_FILE_DEST '/u01/oradata/fra'
         SET DB_CREATE_FILE_DEST '/u01/oradata/ora11gr2/datafiles/'
         SET DIAGNOSTIC_DEST '/u01/app/ora11gr2';
}

Recreate the standby database online

duplicate target database for standby from active database nofilenamecheck;

Backup based Duplication – RAC(ASM) to Single Instance(Non ASM)

--prepare single instance parameter file pfile
--start the database in nomount state
$rman target / nocatalog
RMAN> restore controlfile from '/backup/RMAN_Backup/c-3171721304-20130604-00';

RMAN> alter database mount;

#Register(catalog backuppiece) with Instance's control file
catalog backuppiece '/backup/RMAN_Backup/rman_bkp_0co8pn2i_1_1_DUAAA_20130504_DATAFILE_LVL0_04_05_2013';
catalog backuppiece '/backup/RMAN_Backup/rman_bkp_0do8pn2i_1_1_DUAAA_20130504_DATAFILE_LVL0_04_05_2013';
catalog backuppiece '/backup/RMAN_Backup/rman_bkp_0eo8pn2p_1_1_DUAAA_20130504_DATAFILE_LVL0_04_05_2013';
catalog backuppiece '/backup/RMAN_Backup/rman_bkp_4pob51ag_1_1_DUAAA_20130602_ARCHIVELOG_02_06_2013';

#Now we'll determine the point upto which media recovery should run on the restored database.
RMAN> list backup of archivelog all;

List of Archived Logs in backup set 157
  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
  ---- ------- ---------- --------- ---------- ---------
  1    177     119552481  03-JUN-13 120908582  03-JUN-13
  1    178     120908582  03-JUN-13 122276733  03-JUN-13
  1    179     122276733  03-JUN-13 123800240  03-JUN-13
  2    126     118240294  03-JUN-13 122276757  03-JUN-13

-bash-3.2$ cat recovery.rcv
run{
set until sequence 180 thread 1;
set newname for datafile '+ORASYS/duaaa/datafile/system.264.814546029'  to '/newfs/oradata/duaaa/system.264.814546029';
set newname for datafile '+ORASYS/duaaa/datafile/sysaux.263.814546013'  to '/newfs/oradata/duaaa/sysaux.263.814546013';
set newname for datafile '+ORASYS/orcl/datafile/undotbs1.266.814546097'to '/newfs/oradata/orcl/undotbs1.266.814546097';
set newname for datafile '+ORASYS/orcl/datafile/users.267.814546101'   to '/newfs/oradata/orcl/users.267.814546101';
set newname for datafile '+ORASYS/orcl/datafile/undotbs2.265.814546095' to '/newfs/oradata/orcl/undotbs2.265.814546095';
set newname for datafile '+ORADATA1/orcl/datafile/aaa.dbf'         to '/newfs/oradata/orcl/eaaa.dbf';
set newname for datafile '+ORADATA1/orcl/datafile/tbluserstat01.dbf'  to '/newfs/oradata/orcl/tbluserstat01.dbf';
restore database;
switch datafile all;
recover database;
}

rman target / cmdfile=recovery.rcv

Once RMAN restore/recovery finishes, you will want to rename the online redolog files before opening the database
in case the production path of redo log files is not available on the new host. After renaming the redolog files,
the database can be opened with RESETLOGS

alter database rename file '+ORAREDO//onlinelog/group_2.268.814546121' to '/u01/app/oracle/oradata/orcl/group_2.268.814546121';
alter database rename file '+ORAFRA/orcl/onlinelog/group_2.415.814546183 ' to '/u01/app/oracle/oradata/orcl/group_2.415.814546183';
alter database rename file '+ORAREDO/orcl/onlinelog/group_1.267.814546109' to '/u01/app/oracle/oradata/orcl/group_1.267.814546109';
alter database rename file '+ORAFRA/orcl/onlinelog/group_1.416.814546111 ' to '/u01/app/oracle/oradata/orcl/group_1.416.814546111';
alter database rename file '+ORAREDO/orcl/onlinelog/group_3.269.814546193' to '/u01/app/oracle/oradata/orcl/group_3.269.814546193';
alter database rename file '+ORAFRA/orcl/onlinelog/group_3.414.814546255 ' to '/u01/app/oracle/oradata/orcl/group_3.414.814546255';
alter database rename file '+ORAREDO/orcl/onlinelog/group_4.270.814546257' to '/u01/app/oracle/oradata/orcl/group_4.270.814546257';
alter database rename file '+ORAFRA/orcl/onlinelog/group_4.413.814546259 ' to '/u01/app/oracle/oradata/orcl/group_4.413.814546259';

alter database disable thread 2;

drop tablespace UNDOTBS2 including contents and datafiles;

Reference:-
http://gavinsoorma.com/2013/02/restoring-a-asm-backup-to-non-asm-and-restoring-from-rac-to-single-instance/
http://osamamustafa.blogspot.ae/2012/02/rac-to-single-node-steps.html
http://oracledbahub.com/2012/04/restore-rman-backup-from-one-server-to-another-server-in-10g/
http://dbaregistry.blogspot.ae/2010/01/howto-restore-rac-database-to-single.html

Oracle Documentation
http://docs.oracle.com/cd/B28359_01/backup.111/b28270/rcmdupdb.htm#BRADV010
http://docs.oracle.com/cd/E11882_01/backup.112/e10642/rcmdupdb.htm#BRADV010

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s