Home > Oracle Rac > Duplicate RAC database to another new RAC system

Duplicate RAC database to another new RAC system

Source

4 nodes Oracle 11.2.0.2 on HP-UX 11.31 hostA1 hostB1 hhostC1 hostD1 database romeo

Target

4 nodes Oracle 11.2.0.2 on HP-UX 11.31  hostA2 hostB2 hostC2 hostD2  database Juliet

1. On the source host, backup the source using RMAN. Sample here is shown using control file to disk.

$ORACLE_HOME/bin/rman

oracle@sausalito:/u01/app/oracle/product/11.2.0/db_1/dbs > rman target / catalog rman/rman@rmancpr

Recovery Manager: Release 11.2.0.2.0 – Production on Fri Jan 20 09:08:25 2012

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ROMEO(DBID=498205723)

connected to recovery catalog database

run {
backup format ‘/u1/df_%t_%s_%p’ database
include current controlfile
plus archivelog;
release channel d1;
}

2.  Copy all the backupset files to one of the target hosts to the same location of backup

$scp /rmanbackup/oradata/romeo/df*   hostA2: /rmanbackup/oradata/romeo/

 Create a pfile from the source database and move it to the target system

SQL> create pfile=’/tmp/initjuliet.ora’ from spfile ;

Move initjuliet.ora to the target system $ORACLE_HOME/dbs

3. Edit initjuliet.ora  and change

*.cluster_database=false

And any references of romeo to Juliet

Add convert name if names or paths are different

*.db_file_name_convert = (‘/u02/oradata/romeo’,’/u02/oradata/juliet’)

*.log_file_name_convert= (‘/u02/oradata/romeo’,’/u02/oradata/juliet’)

Create a password file using orapwd on the target host

orapwd file=orapwjuliet password=xxxxxxxx

4. On the target host create a TNSNAME alias pointing to the source database

ROMEO =

  (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = maverick)(PORT = 1521))

    (CONNECT_DATA =

      (SERVER = DEDICATED)

      (SERVICE_NAME = romeo)

    )

  )

5. Startup the Juliet instance in nomount  mode

6. Start the rman duplicate

 rman target sys/xxxxxxx@romeo auxiliary /  catalog rman/rman@rmancpr

 RMAN> run {

allocate channel D1 device type disk;

allocate auxiliary channel D2 device type disk;

DUPLICATE TARGET DATABASE TO juliet;

}

If successfully you should see the following extract at the end

 

datafile 2 switched to datafile copy

input datafile copy RECID=1 STAMP=772991657 file name=/u03/oradata/dupdb/sysaux01.dbf

datafile 3 switched to datafile copy

input datafile copy RECID=2 STAMP=772991657 file name=/u03/oradata/dupdb/undotbs01.dbf

datafile 4 switched to datafile copy

input datafile copy RECID=3 STAMP=772991657 file name=/u03/oradata/dupdb/users01.dbf

datafile 5 switched to datafile copy

input datafile copy RECID=4 STAMP=772991657 file name=/u03/oradata/dupdb/undotbs02.dbf

datafile 6 switched to datafile copy

input datafile copy RECID=5 STAMP=772991657 file name=/u03/oradata/dupdb/undotbs03.dbf

datafile 7 switched to datafile copy

input datafile copy RECID=6 STAMP=772991657 file name=/u03/oradata/dupdb/undotbs04.dbf

 contents of Memory Script:

{

   Alter clone database open resetlogs;

}

executing Memory Script

 database opened

Finished Duplicate Db at 19-JAN-2012 15:54:40

released channel: D1

released channel: D2

7. Add a new temporary file into the temporary table space

 alter tablespace temp add tempfile ‘/u02/oradata/dupdb/temp01.dbf’ size 2048m reuse ;

8. Make the database RAC aware

Each node of the cluster has its own oracle home n u01 and shared filesystem u02 and u03  and therefore needed to make the following changes enable RAC

Shutdown database on hostA2 and move the spfile from $ORACLE_HOME/dbs to /u03/oradata/Juliet

This is shared storage which all the 4 hosts can access

srvctl modify database -d juliet -o /u01/app/oracle/product/11.2.0/db_1 -p /u03/oradata/dupdb/spfilejuliet.ora

srvctl add instance -d julite -i juliet1 –n hostA2

srvctl add instance -d julite -i juliet2 –n hostB2

srvctl add instance -d julite -i juliet3 –n hostC2

srvctl add instance -d julite -i juliet4 –n hostD2

move the password file from hostA2  $ORACLE_HOME/dbs  to /u03/oradata/Juliet

create links  from each host  to the password file in  /u03/oradata/Juliet

hostA2 : $ORACLE_HOME/dbs ln –s /u03/oradata/Juliet/orapwjuliet  orapwdupdb1

hostB2 : $ORACLE_HOME/dbs ln –s /u03/oradata/Juliet/orapwjuliet  orapwdupdb2

hostC2 : $ORACLE_HOME/dbs ln –s /u03/oradata/Juliet/orapwjuliet  orapwdupdb3

hostD2 : $ORACLE_HOME/dbs ln –s /u03/oradata/Juliet/orapwjuliet  orapwdupdb4

on each host create the following init.ora 

hostA2  initjuliet1.ora   containing SPFILE=’/u03/oradata/dupdb/spfiledupdb.ora’

hostB2  initjuliet1.ora   containing SPFILE=’/u03/oradata/dupdb/spfiledupdb.ora’

hostC2  initjuliet1.ora   containing SPFILE=’/u03/oradata/dupdb/spfiledupdb.ora’

hostD2  initjuliet1.ora   containing SPFILE=’/u03/oradata/dupdb/spfiledupdb.ora’

add the following entries on each host /etc/oratab

hostA2        

juliet1:/u01/app/oracle/product/11.2.0/db_1:N     

hostB2

juliet2:/u01/app/oracle/product/11.2.0/db_1:N     

hostC2

juliet3:/u01/app/oracle/product/11.2.0/db_1:N     

hostD2

juliet4:/u01/app/oracle/product/11.2.0/db_1:N     

On hostA2 where the database was created

Mount the database

Export ORACLE_SID=juliet1

SQL> connect / as sysdba

SQL> startup mount

SQL> alter system set cluster_database=TRUE scope=spfile sid=’*’

SQL> shutdown immediate

Start up instances or databases using srvctl

srvctl start instance –d Juliet –I juliet1

Srvctl start instance –d Juliet –I juliet2

Srvctl start instance –d Juliet –I juliet3

Srvctl start instance –d Juliet –I juliet4

9   Add the database to OEM

 You might get the following issues in OEM

 Service romeoXDB and romeo  and any services that existed in romeo is down alert in GRID Control

 Refer to the following article for a resolution and how to avoid the problem

 http://managingoracle.blogspot.com/2011/01/service-xdb-is-down-alert-in-grid.html

 To resolve the problem  if  the services are not relevant  delete them

 SQL> exec dbms_service.delete_service(‘romeoXDB’) ;

SQL> exec dbms_service.delete_service(‘romeo’) ;

useful web links

http://oraexplorer.com/2007/11/rman-duplicate/

http://www.colestock.com/blogs/2007/09/how-to-duplicate-rac-database-using.html

http://www.oracleracexpert.com/2009/12/duplicate-rac-database-using-rman.html

http://surachartopun.com/2009/11/duplicate-without-connection-to-target.html

About these ads
Categories: Oracle Rac
  1. No comments yet.
  1. No trackbacks yet.

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

Follow

Get every new post delivered to your Inbox.

Join 124 other followers

%d bloggers like this: