Non RAC database to a RAC environment

posted May 25, 2011, 6:29 AM by Sachchida Ojha
There are many ways to do this task

1) exp and imp
2) expdp and impdp
3) Rman (with duplicate database command)
4) rconfig Note:387046.1

Single Instance Server: sinstora
RAC Servers: orac1, orac2

# 1. Duplicate DB to new server
# open the auxiliary DB in nomount (make sure to put the pfile in the appropriate location)
rman TARGET sys/password@TESTDB CATALOG rman/rman@rman AUXILIARY /
run {
  ALLOCATE AUXILIARY CHANNEL auxsde1 DEVICE TYPE DISK;
  ALLOCATE AUXILIARY CHANNEL auxsde2 DEVICE TYPE DISK;
  ALLOCATE AUXILIARY CHANNEL auxsde3 DEVICE TYPE DISK;
  DUPLICATE TARGET DATABASE TO TESTDB1 nofilenamecheck;

# make sure to move re-create tempfiles in the appropriate disk group

# 2. Convert database to RAC
@convert_<xx>_to_rac.sql

# 3. start the additional listeners

# 4. Uncomment out RAC-speficic parameters and copy pfile to node2(orac2) making sure to change the instance name

# 5. bounce instance on node1, and start instance on node2
# create spfile on both instances and bounce the databases

# 6. register with crs
sh crs_register_<xx>.sh

# 7. check to make sure all services are registered
/*  for RAT, should see
$ crs_stat |grep PLINK
NAME=ora.TESTDB.TESTDB1.inst
NAME=ora.TESTDB.TESTDB2.inst
NAME=ora.TESTDB.RATSVC.RAT1.srv
NAME=ora.TESTDB.RATSVC.RAT2.srv
NAME=ora.TESTDB.RATSVC.cs
NAME=ora.TESTDB.db
*/


convert_rat_to_rac.sql


-- to be run on orac1 from $DB_HOME
set echo on

create undo tablespace UNDOTBS2 datafile '+DATA' size 1G autoextend on next 100M maxsize 30G;
alter tablespace UNDOTBS2 add datafile '+DATA' size 1G autoextend on next 100M maxsize 30G;


alter database add logfile thread 2
 group  7 ('+DATA','+FRA') size 750M,
 group  8 ('+DATA','+FRA') size 750M,
 group  9 ('+DATA','+FRA') size 750M,
 group 10 ('+DATA','+FRA') size 750M,
 group 11 ('+DATA','+FRA') size 750M,
 group 12 ('+DATA','+FRA') size 750M;

alter database enable public thread 2;

set echo off feed off
@?/rdbms/admin/catclust.sql
set echo on feed on



crs_register_rat.sh
# To be run from GRID_HOME

srvctl add database -d TESTDB -o /u01/app/oracle/product/11.2.0/dbhome_1
srvctl add instance -d RAT -i TESTDB1 -n orac01
srvctl add instance -d RAT -i TESTDB2 -n orac02



Comments