Clone database from ACTIVE standby database.
below steps are useful when you already have ORCL_T datbase ::
SOURCE : STANDBY DATABASE (ORCLSTDBY)
TARGET : TEST DATABASE (ORCL_T)
-- on Testing ( ORCL_T DB) DB
alter system set log_file_name_convert='+DATA_GROUP/orclstby/onlinelog/','+DATA_GROUP/orcl_t/onlinelog/' scope=spfile;
alter system set db_file_name_convert='+DATA_GROUP/orclstby/datafile/','+DATA_GROUP/orcl_t/datafile/' scope=spfile;
alter system set db_unique_name=orcl_t scope=spfile;
create pfile='/tmp/initorcl_t.ora' from spfile;
alter system set cluster_database=false scope=spfile;
shut immediate;
STARTUP NOMOUNT RESTRICT;
ALTER DATABASE MOUNT;
DROP DATABASE;
-- on Standby DB
alter database flashback off;
alter database recover managed standby database cancel;
-- on Testing(For Clone DB) DB
STARTUP NOMOUNT pfile='/tmp/initorcl_t.ora';
Create spfile from pfile='/tmp/initorcl_t.ora';
Startup mount
rman target sys/oracle@orclstby auxiliary sys/oracle@orcl_t
--activerestore_final.cmd
run {
allocate channel C1 device type disk;
allocate channel C2 device type disk;
allocate channel C3 device type disk;
allocate channel C4 device type disk;
allocate channel C5 device type disk;
allocate auxiliary channel C6 device type disk;
allocate auxiliary channel C7 device type disk;
duplicate target database to orcl_t from active database;
release channel C1 ;
release channel C2;
release channel C3;
release channel C4;
release channel C5;
}
-- Make no archivelog on cloned DB.
-- on Standby DB
alter database flashback on;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;
below steps are useful when you already have ORCL_T datbase ::
SOURCE : STANDBY DATABASE (ORCLSTDBY)
TARGET : TEST DATABASE (ORCL_T)
-- on Testing ( ORCL_T DB) DB
alter system set log_file_name_convert='+DATA_GROUP/orclstby/onlinelog/','+DATA_GROUP/orcl_t/onlinelog/' scope=spfile;
alter system set db_file_name_convert='+DATA_GROUP/orclstby/datafile/','+DATA_GROUP/orcl_t/datafile/' scope=spfile;
alter system set db_unique_name=orcl_t scope=spfile;
create pfile='/tmp/initorcl_t.ora' from spfile;
alter system set cluster_database=false scope=spfile;
shut immediate;
STARTUP NOMOUNT RESTRICT;
ALTER DATABASE MOUNT;
DROP DATABASE;
-- on Standby DB
alter database flashback off;
alter database recover managed standby database cancel;
-- on Testing(For Clone DB) DB
STARTUP NOMOUNT pfile='/tmp/initorcl_t.ora';
Create spfile from pfile='/tmp/initorcl_t.ora';
Startup mount
rman target sys/oracle@orclstby auxiliary sys/oracle@orcl_t
--activerestore_final.cmd
run {
allocate channel C1 device type disk;
allocate channel C2 device type disk;
allocate channel C3 device type disk;
allocate channel C4 device type disk;
allocate channel C5 device type disk;
allocate auxiliary channel C6 device type disk;
allocate auxiliary channel C7 device type disk;
duplicate target database to orcl_t from active database;
release channel C1 ;
release channel C2;
release channel C3;
release channel C4;
release channel C5;
}
-- Make no archivelog on cloned DB.
-- on Standby DB
alter database flashback on;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;