Professional Documents
Culture Documents
RAC Duplication
RAC Duplication
===========================================================================
|| 1. NON-RAC/NON-ASM to RAC/ASM
|| 2. RAC/ASM to Non-RAC/Non-ASM
||12.
||13.
||14.
||15.
===========================================================================
Prepare an init.ora file for one RAC instance on one RAC node. Ensure you initially
set the cluster_database
parameter to FALSE.
And now create the UNDO tablespace for the second node:
Also set cluster_database=TRUE in the initialization file, and you should now be
able to start the second node.
================================================ RAC/ASM to Non-RAC/Non-ASM
=========================================================
control_files='/u01/dbfile/DUP/control01.ctl'
db_block_size=8192
db_name='DUP'
fast_start_mttr_target=500
job_queue_processes=10
sga_max_size=400M
sga_target=400M
open_cursors=75
processes=100
remote_login_passwordfile='EXCLUSIVE'
resource_limit=true
standby_file_management='auto'
undo_management='AUTO'
undo_tablespace='UNDOTBS1'
workarea_size_policy='AUTO'
run
{
allocate channel prim1 device type disk;
allocate channel prim2 device type disk;
allocate channel prim3 device type disk;
allocate channel prim4 device type disk;
allocate auxiliary channel AUX_01 device type disk;
allocate auxiliary channel AUX_02 device type disk;
allocate auxiliary channel AUX_03 device type disk;
allocate auxiliary channel AUX_04 device type disk;
DUPLICATE TARGET DATABASE TO DUPFROM ACTIVE DATABASE
DB_FILE_NAME_CONVERT
'+DATA/rac/datafile','/u01/dbfile/DUP',
'+DATA/rac/tempfile','/u01/dbfile/DUP'
LOGFILE
GROUP 1 ('/u01/oraredo/DUP/redo01.rdo') SIZE 50M,
GROUP 2 ('/u01/oraredo/DUP/redo02.rdo') SIZE 50M;
}
run
{
allocate channel prim1 device type disk;
allocate channel prim2 device type disk;
allocate channel prim3 device type disk;
allocate channel prim4 device type disk;
allocate auxiliary channel AUX_01 device type disk;
allocate auxiliary channel AUX_02 device type disk;
allocate auxiliary channel AUX_03 device type disk;
allocate auxiliary channel AUX_04 device type disk;
DUPLICATE TARGET DATABASE TO HVQSQOP0 FROM ACTIVE DATABASE
DB_FILE_NAME_CONVERT
'+DATA/testdb/datafile','/d02/app/oracle/oradata/hvqsqop0',
'+DATA/testdb/tempfile','/d02/app/oracle/oradata/hvqsqop0'
LOGFILE
GROUP 1 ('/d02/app/oracle/oradata/hvqsqop0/redo01.log') SIZE 50M,
GROUP 2 ('/d02/app/oracle/oradata/hvqsqop0/redo02.log') SIZE 50M,
GROUP 3 ('/d02/app/oracle/oradata/hvqsqop0/redo03.log') SIZE 50M;
}
In the previous command, I used the DB_FILE_NAME conversion to ensure that the data
files were mapped properly
from the ASM storage to the regular file system storage.
_no_recovery_through_resetlogs=true
$ rman auxiliary /
run
{
allocate auxiliary channel AUX_01 device type disk;
allocate auxiliary channel AUX_02 device type disk;
allocate auxiliary channel AUX_03 device type disk;
allocate auxiliary channel AUX_04 device type disk;
duplicate database to PROD backup location '/home/oracle/backup' nofilenamecheck;
}
run
{
allocate auxiliary channel AUX_01 device type disk;
allocate auxiliary channel AUX_02 device type disk;
allocate auxiliary channel AUX_03 device type disk;
allocate auxiliary channel AUX_04 device type disk;
duplicate database to 'TEST' backup location '/home/oracle/backup'
nofilenamecheck;
}
create pfile for new sid,modify it, point toward new sid and start
===== RAC
Assume that source data files and online redo log files are stored in ASM disk
group +SOURCEDSK. You want to store the duplicate database files in ASM disk group
+DUPDSK.
DB_FILE_NAME_CONVERT = ("+SOURCEDSK","+DUPDSK")
LOG_FILE_NAME_CONVERT = ("+SOURCEDSK","+DUPDSK")
=====
run{
allocate auxiliary channel AUX_01 device type disk;
allocate auxiliary channel AUX_02 device type disk;
allocate auxiliary channel AUX_03 device type disk;
allocate auxiliary channel AUX_04 device type disk;
DUPLICATE TARGET DATABASE TO 'TEST' BACKUP LOCATION '/home/oracle/backup' SPFILE
set cluster_database='false'
set instance_number='1'
set control_files='+DATA','+DATA2'
set log_file_name_convert='+DATA','+DATA2'
db_file_name_convert='+DATA','+DATA2'
nofilenamecheck;
}
run{
allocate auxiliary channel AUX_01 device type disk;
allocate auxiliary channel AUX_02 device type disk;
allocate auxiliary channel AUX_03 device type disk;
allocate auxiliary channel AUX_04 device type disk;
DUPLICATE TARGET DATABASE TO 'TEST' BACKUP LOCATION '/home/oracle/backup' SPFILE
set cluster_database='false'
set instance_number='1'
nofilenamecheck;
}
create pfile for new sid, modify it, point toward new sid and start
run
{
allocate auxiliary channel AUX_01 device type disk;
allocate auxiliary channel AUX_02 device type disk;
allocate auxiliary channel AUX_03 device type disk;
allocate auxiliary channel AUX_04 device type disk;
DUPLICATE TARGET DATABASE TO TRG BACKUP LOCATION '/u01/rman/TRG'
db_file_name_convert
'/u01/dbfile/TRG','/u01/dbfile/DUP',
'/u02/dbfile/TRG','/u02/dbfile/DUP',
'/u03/dbfile/TRG','/u03/dbfile/DUP'
logfile
group 1 ('/u01/oraredo/DUP/redo01a.rdo','/u02/oraredo/DUP/redo01b.rdo') size 50m,
group 2 ('/u01/oraredo/DUP/redo02a.rdo','/u02/oraredo/DUP/redo02b.rdo') size 50m
UNTIL TIME "TO_DATE('16-dec-2014 09:00:00', 'dd-mon-rrrr hh24:mi:ss')";
}
run{
allocate auxiliary channel AUX_01 device type disk;
allocate auxiliary channel AUX_02 device type disk;
allocate auxiliary channel AUX_03 device type disk;
allocate auxiliary channel AUX_04 device type disk;
DUPLICATE TARGET DATABASE TO 'TEST' BACKUP LOCATION '/home/oracle/backup' SPFILE
set cluster_database='false'
set instance_number='1'
nofilenamecheck
UNTIL TIME "TO_DATE('16-dec-2014 09:00:00', 'dd-mon-rrrr hh24:mi:ss')";
}
run{
allocate auxiliary channel AUX_01 device type disk;
allocate auxiliary channel AUX_02 device type disk;
allocate auxiliary channel AUX_03 device type disk;
allocate auxiliary channel AUX_04 device type disk;
DUPLICATE TARGET DATABASE TO 'TEST' BACKUP LOCATION '/home/oracle/backup' SPFILE
set cluster_database='false'
set instance_number='1'
nofilenamecheck
UNTIL SEQUENCE 28;
}
run
{
allocate auxiliary channel AUX_01 device type disk;
allocate auxiliary channel AUX_02 device type disk;
allocate auxiliary channel AUX_03 device type disk;
allocate auxiliary channel AUX_04 device type disk;
DUPLICATE TARGET DATABASE TO TRG BACKUP LOCATION '/home/oracle/backup' UNTIL
RESTORE POINT my_rp SPFILE
set cluster_database='false'
set instance_number='1'
NOFILENAMECHECK;
}
run
{
allocate channel prim1 device type disk;
allocate channel prim2 device type disk;
allocate channel prim3 device type disk;
allocate channel prim4 device type disk;
allocate auxiliary channel AUX_01 device type disk;
allocate auxiliary channel AUX_02 device type disk;
allocate auxiliary channel AUX_03 device type disk;
allocate auxiliary channel AUX_04 device type disk;
duplicate target database to DUP from active database nofilenamecheck;
}
run
{
allocate channel prim1 device type disk;
allocate channel prim2 device type disk;
allocate channel prim3 device type disk;
allocate channel prim4 device type disk;
allocate auxiliary channel AUX_01 device type disk;
allocate auxiliary channel AUX_02 device type disk;
allocate auxiliary channel AUX_03 device type disk;
allocate auxiliary channel AUX_04 device type disk;
duplicate target database to PROD from active database nofilenamecheck;
}
run
{
allocate channel prim1 device type disk;
allocate channel prim2 device type disk;
allocate channel prim3 device type disk;
allocate channel prim4 device type disk;
allocate auxiliary channel AUX_01 device type disk;
allocate auxiliary channel AUX_02 device type disk;
allocate auxiliary channel AUX_03 device type disk;
allocate auxiliary channel AUX_04 device type disk;
duplicate target database to PROD from active database spfile
set cluster_database='false'
set instance_number='1'
nofilenamecheck;
}
run
{
duplicate target database to PROD from active database spfile
set cluster_database='false'
set instance_number='1'
nofilenamecheck;
}
======================================== ACTIVE Duplication (Directory Structure
and Database Name different) SPFILE =========================================
run
{
allocate channel prim1 device type disk;
allocate channel prim2 device type disk;
allocate channel prim3 device type disk;
allocate channel prim4 device type disk;
allocate auxiliary channel AUX_01 device type disk;
allocate auxiliary channel AUX_02 device type disk;
allocate auxiliary channel AUX_03 device type disk;
allocate auxiliary channel AUX_04 device type disk;
duplicate target database to 'TEST' from active database spfile
set cluster_database='false'
set instance_number='1'
nofilenamecheck;
}
==================
run{
allocate auxiliary channel AUX_01 device type disk;
allocate auxiliary channel AUX_02 device type disk;
allocate auxiliary channel AUX_03 device type disk;
allocate auxiliary channel AUX_04 device type disk;
DUPLICATE TARGET DATABASE TO 'TEST' BACKUP LOCATION '/home/oracle/backup' SPFILE
set cluster_database='false'
set instance_number='1'
set control_files='+DATA','+DATA2'
set log_file_name_convert='+DATA','+DATA2'
db_file_name_convert='+DATA','+DATA2'
nofilenamecheck;
}
run
{
allocate channel prim1 device type disk;
allocate channel prim2 device type disk;
allocate channel prim3 device type disk;
allocate channel prim4 device type disk;
allocate auxiliary channel AUX_01 device type disk;
allocate auxiliary channel AUX_02 device type disk;
allocate auxiliary channel AUX_03 device type disk;
allocate auxiliary channel AUX_04 device type disk;
duplicate target database to 'TEST' from active database spfile
set cluster_database='false'
set instance_number='1'
nofilenamecheck
UNTIL TIME "TO_DATE('16-dec-2014 09:00:00', 'dd-mon-rrrr hh24:mi:ss')";
}
run
{
allocate channel prim1 device type disk;
allocate channel prim2 device type disk;
allocate channel prim3 device type disk;
allocate channel prim4 device type disk;
allocate auxiliary channel AUX_01 device type disk;
allocate auxiliary channel AUX_02 device type disk;
allocate auxiliary channel AUX_03 device type disk;
allocate auxiliary channel AUX_04 device type disk;
duplicate target database to 'TEST' from active database spfile
set cluster_database='false'
set instance_number='1'
nofilenamecheck
UNTIL SEQUENCE 28;
}
run
{
allocate channel prim1 device type disk;
allocate channel prim2 device type disk;
allocate channel prim3 device type disk;
allocate channel prim4 device type disk;
allocate auxiliary channel AUX_01 device type disk;
allocate auxiliary channel AUX_02 device type disk;
allocate auxiliary channel AUX_03 device type disk;
allocate auxiliary channel AUX_04 device type disk;
duplicate target database to 'TEST' from active database UNTIL RESTORE POINT
my_rp spfile
set cluster_database='false'
set instance_number='1'
nofilenamecheck;
}
======================================================