Wednesday, August 9, 2017


Steps for RMAN DUPLICATE FROM ACTIVE 

Single instance to RAC


Migrate a single instance database TSTDEV to a two node RAC  database TSTPRD

Source database

Database name            TSTDEV
Single instance
Version                           11.2.0.3
Hostname                       tstqadb
Filesystem                      ASM


Target database

Database name            TSTPRD
RAC  Two nodes
Version                           11.2.0.3
ORACLE_HOME          /tst/oracle/product/11.2.0/db1
GI_HOME                       /tst/grid/11.2.0/
Hostname                       lmstg01/lmstg02
Filesystem                      ASM
Diskgroup                      +DG01

Note: For the target already have my Oracle clusterware in place on lmstg01/lmstg02. An empty database with two instances, controlfiles, spfiles and diskgroup – +DG01 is already in place.

Prepare auxiliary instance TSTPRD1 on lmstg01
Stop the cluster database
srvctl stop database -d TSTPRD
Start the TSTPRD1 instance which runs on lmstg01

srvctl start instance -d TSTPRD -i TSTPRD1

Set following parameters on TSTPRD1 instance:







. oraenv TSTPRD1
sqlplus / as sysdba 
alter system set db_name=TSTPRD scope=spfile;
alter system set db_create_file_dest='+DG01';
alter system set cluster_database=false scope=spfile;

shutdown immediate
startup nomount

Enable static registration for TSTPRD1 -LISTENER

Add following entries into listener.ora file in GI_HOME on lmstg01
Edit /tst/grid/11.2.0/network/admin/listener.ora and add following lines:








SID_LIST_LISTENER =
  (SID_LIST =
    )
    (SID_DESC =
      (SID_NAME = TSTPRD1)
      (ORACLE_HOME = /tst/oracle/product/11.2.0/db1)
      (GLOBAL_DBNAME = TSTPRD)
    )
  )
Verify ORACLE_HOME  is set to TSTPRD database home

Edit TNS entries for BOTH auxiliary and target tnsnames.ora file to add below lines 
















TSTDEV =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = tstqadb)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = TSTDEV)
    )
  )

TSTPRD1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = lmstg01)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = TSTPRD)
    )
  )

Create a password file for auxiliary instance TSTPRD1 on lmstg01

Password file is needed for both auxiliary and target connections as Connections to both instances will be through listener and using TNS



. oraenv
TSTPRD1
cd $ORACLE_HOME/dbs
orapwd password=sys file=orapwTSTPRD1

Test connectivity to auxiliary and target instance from BOTH hosts using TNS


sqlplus sys/sys@TSTPRD1 as sysdba
sqlplus sys/sys@TSTDEV as sysdba

From auxiliary host start RMAN and run the DUPLICATE command







. oraenv
TSTPRD1
rman target sys/sys@TSTDEV auxiliary sys/sys@tstprd1
RMAN>run{
         DUPLICATE TARGET DATABASE TO TSTPRD
         FROM ACTIVE DATABASE;
        }

Change the TSTPRD database to be cluster database again

        . oraenv TSTPRD1
        sqlplus / as sysdba

alter system set cluster_database=true scope=spfile;
shutdown immediate

Using srvctl start TSTPRD database


srvctl start db -d TSTPRD

No comments:

Post a Comment

  How to Change Instance Type & Security Group of EC2 in AWS By David Taylor Updated April 29, 2023 EC2 stands for Elastic Compute Cloud...