Forgot your password?    
+ Reply to Thread
Results 1 to 1 of 1

Thread: Duplicate Database using RMAN

  1. #1
    Expert Oracle Administrator
    Join Date
    Oct 2011
    Location
    New Delhi, India
    Posts
    427

    Duplicate Database using RMAN

    This procedure will clone a database onto the same server using RMAN duplicate.

    To use RMAN duplicate , an RMAN backup of the source database is required.

    1. Create a pfile for the new database
    This step assumes that the source database is using a spfile. If that is not the case, simply make a copy the existing pfile.

    Connect to the source database as sysdba and run the following:

    create pfile='init<new database sid>.ora' from spfile;
    This will create a new pfile in the $ORACLE_HOME/dbs directory.

    The new pfile will need to be edited immediately. If the cloned database is to have a different name to the source, this will need to be changed, as will any paths. Review the contents of the file and make alterations as necessary.

    Because in this example the cloned database will reside on the same machine as the source, Oracle must be told how convert the filenames during the RMAN duplicate operation. This is achieved by adding the following lines to the newly created pfile:

    db_file_name_convert=(<source_db_path>,<target_db_ path>)
    log_file_name_convert=(<source_db_path>,<target_db _path>)


    2. Create bdump, udump & cdump directories

    Create bdump, udump & cdump directories as specified in the pfile from the previous step.


    3. Add a new entry to oratab, and source the environment
    Edit the /etc/oratab and add an entry for the new database.

    Set ORACLE_HOME and $ORACLE_SID as per the values of the new database
    echo $ORACLE_SID
    echo $ORACLE_HOME

    (Listener should be up and running for the target and the catalog database , and the tnsnames.ora of the auxiliary database should contain the entries for the Connection Identifiers to connect to target and catalog database)

    4. Create a password file

    Use the following command to create a password file (add an appropriate password to the end of it):

    orapwd file=${ORACLE_HOME}/dbs/orapw${ORACLE_SID} password=<your password>

    5. Duplicate the database

    From sqlplus, start the instance up in nomount mode:

    startup nomount
    Exit sqlplus, start RMAN and duplicate the database.

    If no recovery catalog is available. :

    rman target sys@<source_database> nocatalog auxiliary /

    If recovery catalog is available. :

    rman target sys@<source_database> catalog <rman user>/<rman user pwd>@<recovery catalog DB> auxiliary /

    duplicate target database to <clone database name>;
    This will restore the database and apply some archive logs.


    6. Create an spfile

    From sqlplus:

    create spfile from pfile;

    shutdown immediate
    startup
    Now that the clone is built, we no longer need the file_name_convert settings:

    alter system reset db_file_name_convert scope=spfile sid='*'
    /

    alter system reset log_file_name_convert scope=spfile sid='*'
    /

    7. Optionally take the clone database out of archive log mode

    RMAN will leave the cloned database in archive log mode. If archive log mode isn't required, run the following commands from sqlplus:

    shutdown immediate
    startup mount
    alter database noarchivelog;
    alter database open;

    8. Configure TNS

    Add entries for new database in the listener.ora and tnsnames.ora as necessary, and start the listener



    The following link illustrates a example to create a Duplicate Database using RMAN :
    RMAN-Procedure-to-Duplicate-the-Database

+ Reply to Thread

Similar Threads

  1. Database Migration From Windows to Linux Using RMAN
    By mamta in forum Database Installation,Upgrades,Migration,Patching and Cloning
    Replies: 1
    Last Post: 01-10-2012, 01:41 AM
  2. Replies: 0
    Last Post: 01-01-2012, 04:59 PM
  3. Migrate / Convert Oracle Database from Non-ASM to ASM Using RMAN
    By Hemant in forum RAC Installation, ASM Install , ASM Administration
    Replies: 1
    Last Post: 11-27-2011, 06:32 PM
  4. Clone Database using RMAN Duplicate Database Feature
    By Hemant in forum Database Installation,Upgrades,Migration,Patching and Cloning
    Replies: 0
    Last Post: 11-23-2011, 11:38 AM
  5. RMAN Procedure to Duplicate the Database
    By Amit in forum Backup, Restoration & Recovery, RMAN, Flashback, Datapump, Export, Import
    Replies: 1
    Last Post: 11-13-2011, 10:44 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

DBA Lounge (P) Ltd. deals in Oracle Technologies on Consulting, Resourcing, Corporate Training


Online and corporate training available on Oracle Database 11g, Oracle 11g Real Application Cluster (RAC), Oracle Applications 11i/R12, Oracle Fusion Middleware 11g, Oracle Identity Management-OIM, Oracle Internet Directory 11g-OID, Oracle Business Intelligence Enterprise Edition-OBIEE, Oracle Golden Gate, Oracle Access Management-OAM, Oracle Internet Directory-ODS, Oracle Identity Analytics Architecture-OIA Statistics