http://www.pythian.com/blog/duplicate-from-active-database-using-rman-step-by-step/
http://oracle-base.com/articles/11g/duplicate-database-using-rman-11gr2.php#active_database_duplication
In active database duplication, RMAN connects as TARGET to the source database instance and as AUXILIARY to the auxiliary instance. RMAN copies the live source database over the network to the auxiliary instance, thereby creating the duplicate database. No backups of the source database are required.
1)Start the db in nomount ON TARGET SERVER
2)Run the following commands from source
$ cat run_duplicate_db.sh
rman cmdfile=/rama/local/oracle/bin/dup_target_db02.rman log=/rama/local/oracle/bin/dup_target_db01.log
$ cat /rama/local/oracle/bin/dup_target_db02.rman
CONNECT TARGET sys/pwd@source_db
CONNECT AUXILIARY SYS/pwd@target_db
run {
ALLOCATE CHANNEL l1 TYPE DISK;
ALLOCATE CHANNEL l2 TYPE DISK;
ALLOCATE AUXILIARY CHANNEL a1 TYPE DISK;
ALLOCATE AUXILIARY CHANNEL a2 TYPE DISK;
DUPLICATE TARGET DATABASE TO target_db FROM ACTIVE DATABASE
SPFILE
parameter_value_convert 'source_db','target_db'
set control_files =
'/rama/local/oracle/database/target_db/cntl/cntl_01.ctl','/rama/local/oracle/database/target_db/cntl/cntl_02.ctl','/rama/local/oracle/database/target_db/cntl/cntl_03.ctl'
set db_file_name_convert='/rama/local/oracle/database/source_db','/rama/local/oracle/database/target_db'
set log_file_name_convert='/rama/local/oracle/database/source_db','/rama/local/oracle/database/target_db'
set db_recovery_file_dest='/rama/local/oracle/flashback'
set db_unique_name='target_db'
set instance_name='target_db'
set log_archive_format='target_db%t_%s_%r.arc'
set log_archive_dest_state_1='enable'
set remote_login_passwordfile='exclusive'
set service_names='target_db'
NOFILENAMECHECK;
}
http://oracle-base.com/articles/11g/duplicate-database-using-rman-11gr2.php#active_database_duplication
In active database duplication, RMAN connects as TARGET to the source database instance and as AUXILIARY to the auxiliary instance. RMAN copies the live source database over the network to the auxiliary instance, thereby creating the duplicate database. No backups of the source database are required.
1)Start the db in nomount ON TARGET SERVER
2)Run the following commands from source
$ cat run_duplicate_db.sh
rman cmdfile=/rama/local/oracle/bin/dup_target_db02.rman log=/rama/local/oracle/bin/dup_target_db01.log
$ cat /rama/local/oracle/bin/dup_target_db02.rman
CONNECT TARGET sys/pwd@source_db
CONNECT AUXILIARY SYS/pwd@target_db
run {
ALLOCATE CHANNEL l1 TYPE DISK;
ALLOCATE CHANNEL l2 TYPE DISK;
ALLOCATE AUXILIARY CHANNEL a1 TYPE DISK;
ALLOCATE AUXILIARY CHANNEL a2 TYPE DISK;
DUPLICATE TARGET DATABASE TO target_db FROM ACTIVE DATABASE
SPFILE
parameter_value_convert 'source_db','target_db'
set control_files =
'/rama/local/oracle/database/target_db/cntl/cntl_01.ctl','/rama/local/oracle/database/target_db/cntl/cntl_02.ctl','/rama/local/oracle/database/target_db/cntl/cntl_03.ctl'
set db_file_name_convert='/rama/local/oracle/database/source_db','/rama/local/oracle/database/target_db'
set log_file_name_convert='/rama/local/oracle/database/source_db','/rama/local/oracle/database/target_db'
set db_recovery_file_dest='/rama/local/oracle/flashback'
set db_unique_name='target_db'
set instance_name='target_db'
set log_archive_format='target_db%t_%s_%r.arc'
set log_archive_dest_state_1='enable'
set remote_login_passwordfile='exclusive'
set service_names='target_db'
NOFILENAMECHECK;
}


No comments