Wednesday, December 23, 2009

Duplicate RAC Database Using RMAN

Oracle provides following methods to convert a single instance database to RAC. You can choose any method based upon your convince.
1. Manual (Using RMAN)
2. Enterprise Manager
3. DBCA
4. RCONFIG (from 10gR2)

Duplicating RAC database is very simple, first duplicate RAC Database to a single instance using RMAN and convert the single instance into a RAC cluster. Please note that straight RAC to RAC duplicate is not possible.

Follow the simple steps to duplicate RAC Database using ASM or other filesystem.



Step1: Create a parameter file for duplicate database(auxiliary)
The easy ways is copy Init.ora parameter from Target database, replace the Target database name with Auxiliary database name and comment all RAC related parameters for ex:- cluster_database, cluster_instances, thread ...Etc

Set CONTROL_FILES to two copies of the control file to +DISKGRP or file system

Step 2: Set DB_FILE_NAME_CONVERT and LOG_FILE_NAME_CONVERT to convert the datafile and redo log file names from +DISKGRP1 to +DISKGRP2 or /dbs1 to /dbs2 (For Non-ASM file systems)

Also Set DB_CREATE_FILE_DEST and DB_CREATE_ONLINE_DEST_n to ‘+DISKGRP2’ or /dbs2

Step 3: set _no_recovery_through_resetlogs=TRUE parameter to avoid internal Bug 4355382 ORA-38856: FAILED TO OPEN DATABASE WITH RESETLOGS WHEN USING RAC BACKUP

Step 4: Create a password file for auxiliary database using below command.
$ orapwd file=orapwdupDB password=xxxxxxxx

Step 5: Create a static listener for auxiliary database and reload, because auxiliary database will not register itself with the listener.

(SID_DESC =
(GLOBAL_DBNAME =dupDB.oracleracexpert.com)
(ORACLE_HOME = /oracle/product/db/10202)
(SID_NAME = dupDB)
)

Step 6: Take Full database backup of Target database
RMAN > backup database plus archivelog;

Copy the backup dumps from Target to Auxiliary host. If backup directory structure is different then update the RMAN configuration of the target database to reflect the new backup location

RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/oracle/rman/dupDB';

Step7: Set ORACLE_SID and start auxiliary database in NO MOUNT state
$ export ORACLE_SID=dupDB
SQL> startup nomount

Step 8: Duplicate Target Database using RMAN Duplicate command
RMAN> CONNECT TARGET /;
RMAN> CONNECT CATALOG rman/*****@catadb;
RMAN> CONNECT AUXILIARY sys/*****@dupDB;
RMAN> DUPLICATE TARGET DATABASE TO dupDB;

Step 9: Add second thread of online redo logs and enable that thread:
SQL> alter database add logfile thread 2
group 3 ('+DISKGRP1','+DISKGRP2') size 50m reuse;
SQL> alter database add logfile thread 2
group 4 ('+DISKGRP1','+DISKGRP2') size 50m reuse;
SQL> alter database enable public thread 2;

For Non-ASM file systems replace ‘+DISKGRP1’, ‘+DISKGRP2' with actual file systems path

Step 10: Uncomment or add all RAC related parameters, shutdown the instance and startup both Instances.

Step 11: create spfile on the shared storage, because all instances must use the same server parameter file. See the link to “Create spfile from pfile”.

Step12: Register RAC instances with CRS
$ srvctl add database -d dupDB -o /oracle/product/db/10202
$ srvctl add instance -d dupDB -i dupDB1 -n testrac01
$ srvctl add instance -d dupDB -i dupDB2 -n testrac02

Step13: Shutdown and startup instances using srvctl
$ srvctl start database –d dupDB

Regards,
Satishbabu Gunukula
http://www.oracleracexpert.com/

22 comments:

  1. Nice documentation for the clone in RAc. make the life easy. Thanks Gagan

    ReplyDelete
  2. CONNECT AUXILIARY sys/*****@dupDB; Fails if the database is in nomount as the listener status is shown as "Blocked"
    .
    When the database is in nomount stage, the listener shows status "BLOCKED" and disables all the connections with @ORACLE_SID

    ReplyDelete
  3. this is another way of doing the connections:
    .
    [oracle@host dbs]$ rman target sys/*******@PROD auxiliary /

    Recovery Manager: Release 10.2.0.4.0 - Production on Thu Mar 4 13:33:16 2010

    Copyright (c) 1982, 2007, Oracle. All rights reserved.

    connected to target database: PROD (DBID=1850275178)
    connected to auxiliary database: dupDB (not mounted)

    RMAN>

    ReplyDelete
  4. The auxiliary instance does not yet have a control file, you can only start the instance in NOMOUNT mode. Do not create a control file or try to mount or open the auxiliary instance.

    Please note that we have created a static listener for auxiliary database, because it will not register itself with the listener.

    Follow the steps and you will not see any issue.

    ReplyDelete
  5. Thank you so much for your precious information.
    www.rmanbackup.com

    ReplyDelete
  6. Dear satishbabu,
    I am Khalid,I am new for RAC, Really your post are lot help full. plz keep it up.
    Your making DBA easy for new DBAs. Thank you very much for your valuable post.
    Satish plz could you suggest me how can I come good In RAC.

    Thanks:
    Syed Khalid Ali
    email: khalid_dba@yahoo.com

    ReplyDelete
  7. Understanding the architecture is very important in RAC. I would advice to read Oracle doc first before going to any books. Also make sure you create a test environment and do practice, just reading the books/documentation is not enough.

    ReplyDelete
  8. This is an Excellent blog and i did the same duplicating database on stand alone for 11gr2 :

    http://chandu208.blogspot.com/2011/12/11g-rman-cloning-using-duplicate.html

    ReplyDelete
  9. thank, it's very useful

    KhanhND

    ReplyDelete
  10. if i dont have recovery catalog ; will these steps work ?

    ReplyDelete
  11. yes, these steps works with out recovery catalog.

    Regards
    http://www.oracleracexpert.com

    ReplyDelete
  12. This particular weblog is seriously interesting, keep blogging good info.
    gagan enterprises

    ReplyDelete
  13. Hi, I was simply checking out this blog and I really admire the premise of the articlegagan enterprises

    ReplyDelete
    Replies
    1. Its nice to hear that my website is helpful to you.

      Regards
      Satishbabu Gunukula
      http://www.oracleracexpert.com

      Delete
  14. I would like more information about this, because it is very nice. Thanks for sharing!
    happy wheels | friv | girlsgogames | games2girls | happy wheels

    ReplyDelete
  15. baixar facebook é um rede social maior no tudo mundo. O desenvolvimento de Facebook no celular é realizado e desenvolvido pelo Mark Zuckerberg. Foi conhecido como um aplicativo gratuito de mensagens mais famoso e popular no mundo, baixar whatsapp é um metodo perfeito para segurá-los contatos com os seus amigos que não tem de pagar mais nenhuma taxa.

    ReplyDelete
  16. The blog or and best that is extremely useful to keep I can share the ideas. Age Of War 2
    Big Farm | Slitherio | Tank Trouble
    Of the future as this is really what I was looking for, I am very comfortable and pleased to come here. Thank you very much.
    Happy Wheels | Goodgeme Empire | Slither.io

    ReplyDelete
  17. Such a very useful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article.

    Discover our website bounty of free online games now!
    Our website has the biggest collection of free online games. Totally new games are added every day!

    age of war 2
    gold Miner 2
    unfair Mario 2
    cubefield 2
    tanki Online 2

    ReplyDelete
  18. for beginners like me need a lot of reading and searching for information on various blogs. and articles that you share a very nice and inspires me . cara menggugurkan kandungan

    ReplyDelete