Scenario for Creating a Duplicate Database on a Remote Host in RMAN Mode

In this scenario you can duplicate a database on a remote host with the same directory structure as of original database. In this example the original database is orcl and the hostname of the original database is host1, the original database orcl uses an RMAN recovery catalog database catdb on host2. While the duplicate database name will be dup and the hostname of the duplicate database is host3.

To create a duplicate database on a remote host

  1. On the host1, do one full backup for target database orcl with CA ARCserve Oracle Agent to make sure we have the necessary backups and archived redo logs. Here you can start the Oracle Agent Configuration utility to enable submit job from the RMAN console and configure the Oracle Agent.
    C:\> rman catalog rman/rman@catdb target sys/sys_pwd@orcl
    RMAN> run {
    allocata channel dev1 type "sbt_tape"
    backup database plus archivelog;
    release channel dev1;}
    

    Note: Ensure you must enable rman catalog to do the full backup and perform the full backup from GUI.

  2. On host3, create one Auxiliary Instance with oradim.
    oradim -new -sid dup
    
  3. On the host3, create an Oracle Password File for the Auxiliary Instance. For example:
    Orapwd file="c:\oracle\product\10.2.0\db_1\database\PWDdup.ora" password=sys_pwd entries=5
    
  4. Establish Oracle Net Connectivity to the Auxiliary Instance.
  5. On the host3, create an initialization parameter file initdup.ora for the auxiliary instance dup.

    Following are the examples of the initialization parameter settings for the duplicate database:

    db_name=dup
    db_unique_name=dup
    background_dump_dest='C:\oracle\product\10.2.0\admin\dup\bdump'
    compatible='10.2.0.1.0'
    control_files='C:\oracle\product\10.2.0\oradata\dup\control01.ctl','C:\oracle\product\10.2.0\oradata\dup\control02.ctl','C:\oracle\product\10.2.0\oradata\dup\control03.ctl'
    core_dump_dest='C:\oracle\product\10.2.0\admin\dup\cdump'
    user_dump_dest='C:\oracle\product\10.2.0\admin\dup\udump'
    DB_FILE_NAME_CONVERT=('c:\oracle\product\10.2.0\oradata\orcl','C:\oracle\product\10.2.0\oradata\dup\')
    LOG_FILE_NAME_CONVERT=('c:\oracle\product\10.2.0\oradata\orcl','C:\oracle\product\10.2.0\oradata\dup\')
    
  6. Now on the host3, start the auxiliary instance

    Before you begin the RMAN duplication, use SQL*Plus to connect to the auxiliary instance and start it in NOMOUNT mode (specifying a parameter file). In this example, sys_pwd is the password for the user with SYSDBA authority and dup is the net service name for the auxiliary instance.

    SQL> connect sys/sys_pwd@dup
    SQL> startup nomount pfile=' c:\oracle\product\10.2.0\db_1\database\PWDdup.ora ';
    

    Note: Because the auxiliary instance does not have a control file, you can only start the instance in the NOMOUNT mode. Do not create a control file or try to mount or open the auxiliary instance.

  7. You can install CA ARCserve Oracle Agent and start Oracle agent configuration utility on the host3. Ensure the instance dup is checked to protect.
  8. Modify config.xml in directory %Oracle_Agent_Home% to enable alternative restore.

    Locate the following section in config.xml file:

    <AlternateRestore>
    	     <IsAnyOriginalHost>0</IsAnyOriginalHost>
    	     <OriginalHost\>
    
    	</AlternateRestore>
    

    You can perform alternate restore using Set OriginalHost equal to the host1 or Set IsAnyOriginalHost to 1.

  9. On the host1, use RMAN to connect to the target database, the duplicate database, and the recovery catalog database and issue Duplicate command.
    C:\> rman catalog rman/rman@catdb target sys/sys_pwd@orcl auxiliary sys/sys_pwd@dup 
    connected to target database: ORCL (DBID=1143972091)
    connected to recovery catalog database
    connected to auxiliary database: DUP (not mounted)
    RMAN> run 
    {
    allocate auxiliary channel aux1 type "sbt_tape";
    duplicate target database to dup;
    release channel aux1;
    }
    
  10. Database duplication is complete. You can now run the following command on host3,
    C:\> sqlplus / as sysdba
    

    Connected to:

    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production

    With the Partitioning, OLAP and Data Mining options

    SQL> select status from v$database;
    STATUS
    ----------
    OPEN
    SQL> SELECT NAME FROM V$DATABASE;
    NAME
    ---------
    
    DUP
    


Copyright © 2010 CA. All rights reserved. Email CA about this topic