Duplicate Database Without Connecting To Target Database From RAC ASM to RAC ASM

Here is an example of refreshing RAC  TEST database from source RAC PROD database without connecting to source RAC PROD database by using its backups on tapes.

Environment:
1)Duplicate RAC Database: RACTEST (ractest1, ractest2) — to be duplicated and refreshed from source RACPROD database backups on tapes.
2)Source RAC Database: RACPROD (racprod1,racprod2)
3) Diskgroups:  +DGTEST for RACTEST database, +DGPROD for RACPROD database.

 Implementation Steps:
1) If not any, create a pfile from spfile of RACTEST, if it is for refreshing current RACTEST.

2) Make a backup of of all service definition of current RACTEST database, we need recreate them back afterwards.

$srvctl config service -d RACTEST

3) Run below queries against current  RACTEST database, and record the all information:

SQL> select name from v$datafile;
SQL> select * from v$log;
SQL> select * from v$controlfile;

4) Copy password file from source RACPROD to RACTEST  node 1 ( ractest1), and rename it to “orapwRACTEST1”, and also copy it onto ractest2 as “orapwRACTEST2”.

5) Drop current RACTEST database cleanly as per “How to Drop a RAC Database“.

6) Create a new pfile for RACTEST1 as below:

$cat initRACTEST1.ora
*.DB_NAME=RACTEST
*.cluster_database=false
*.audit_file_dest='/u01/app/oracle/admin/RACTEST/adump'
*.db_unique_name='RACTEST'
*.sga_target=16G
*.control_files='+DGTEST',+FRA'
*.db_file_name_convert='+DGPROD','+DGTEST'
*.log_file_name_convert='+DGPROD','+DGTEST'
*.db_create_file_dest='+DGTEST'
*.db_create_online_log_dest_1='+DGTEST'
*.db_create_online_log_dest_2='+FRA'
*.db_recovery_file_dest='+FRA'
*.db_recovery_file_dest_size=214748364800
*.db_files=1021 # default db_files=200 is not big enough for this database

7) Create a below RMAN file. We assume node racprod1 is the node where RMAN backupwas were done for RACPROD database.

$cat rman_refresh_RACTEST.rman
run {
allocate auxiliary channel dupch1 type sbt_tape parms='ENV=(NB_ORA_CLIENT=racprod1)';
allocate auxiliary channel dupch2 type sbt_tape parms='ENV=(NB_ORA_CLIENT=racprod1)';
allocate auxiliary channel dupch3 type sbt_tape parms='ENV=(NB_ORA_CLIENT=racprod1)';
allocate auxiliary channel dupch4 type sbt_tape parms='ENV=(NB_ORA_CLIENT=racprod1)';
DUPLICATE DATABASE RACPROD TO RACTEST UNTIL TIME "TO_DATE('4-FEB-2017 07:00:00','DD-MON-YYYY HH24:MI:SS')";
}

8) Startup RACTEST database in nomount status

SQL> startup nomount ;

9) Issue duplicate process as backend processes:

 $nohup rman  auxiliary /  catalog rman/rman@rman cmdfile=rman_refresh_RACTEST.rman log=rman_refresh_RACTEST_output.log  &

10) Monitor the duplicate process until it is complete.

11)After duplicate is done, implement the post refreshing steps:

a:Check and add redo log groups for second thread ( it should have been there ).
b)Create SPFILE from original backup of SPFILE with “Cluster_database=true”
c)Check and enable thread for second instance( it should have been there ).
d)Add RACTEST database and its instances into cluster. Then start database with SPFILE.
e)Drop services from RACPROD database, and create services for RACTEST from previous backup.
f) Recreate and enable Changing Tracking File:

SQL> ALTER DATABASE ENABLE BLOCK CHANGE TRACKING USING FILE '+DGTETS';

g) Configure Snapshot Control File Name:

RMAN> CONFIGURE SNAPSHOT CONTROLFILE NAME TO '+DGTEST/RACTEST/snapcf_RACTEST.f';

h) Register database into RMAN catalog repository:

$rman target / catalog rman/rman@rman

RMAN> register database;

database registered in recovery catalog
starting full resync of recovery catalog
full resync complete

i) Check and change monitoring credentials on OEM 12c console. Change SYS and SYSTEM password as per environment security rule.

Advertisements
This entry was posted in GI and RAC, RMAN Restore and Recovery and tagged , , , , , , , . Bookmark the permalink.

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