RMAN Duplicate From Dataguard Active Database' | https://www.xedok.com/posts

RMAN Duplicate From Dataguard Active Database

Posted on: 2025-01-28 16:52:36


RMAN Duplicate is a component in Oracle Recovery Manager (RMAN) that empowers you to make a copy data set from a backup or a live data set. You can use a standby database as the source database for a duplicate database when creating one. The most common procedures for performing an RMAN Duplicate on a Dataguard Active Database are as follows:

1.         Make certain that the standby database is operating in read-only mode and that the Dataguard environment has been properly configured.

2.         The duplicate database will be created on the target host by connecting to the RMAN utility.

3.         The target database and the duplicate database should be used for the auxiliary and target instances, respectively.

4.         Set the target database's DBID.

5.         Set up the settings on the network to connect to the source database.

6.         Describe the location of the source database backup in the backup location.

7.         Select true for the active duplication parameter.

8.         Set the copy information base name.

9.         Include any additional options that are required, such as where the redo log files and control files are located.

10.       Executing the RMAN DUPLICATE command will initiate the process of creating duplicate databases.

 

Here is an example command:

 

Create Duplicate Database from Active Database.

In Auxiliary server :

1. Create the parameter file . Look at the example :

initTEST.ora
------------
DB_NAME=TEST 
diagnostic_dest='\oracle' 
DB_FILE_name_CONVERT=('\app\apadhi\oradata\amar','\oracle\oradata\test') 
LOG_FILE_NAME_CONVERT=( '\app\apadhi\oradata\amar','\oracle\oradata\test')
SGA_TARGET=262144000 
CONTROL_FILES='\oracle\oradata\TEST\control01.dbf' 
COMPATIBLE= 11.1.0.0.0
 

 

2. Create the database service ( only for windows ) and password file . Look at the example :

 

% set ORACLE_SID=TEST
% set ORACLE_HOME=\oracle\product\11.1.0\db_1
% orapwd FILE=\oracle\product\11.1.0\db_1\database\PWDTEST.ora PASSWORD=sys

For unix/Linux no need to create the service. Rest other steps are same.

3. Start the Auxiliary instance . Look at the example :

% sqlplus / as sysdba 

SQL*Plus: Release 11.1.0.6.0 - Production on Wed Aug 1 20:33:30 2007 

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

Connected to an idle instance. 

SQL> startup NOMOUNT pfile=\oracle\product\11.1.0\db_1\database\initTEST.ora 
ORACLE instance started. 

Total System Global Area  150667264 bytes 
Fixed Size                  1331732 bytes 
Variable Size              92278252 bytes 
Database Buffers           50331648 bytes 
Redo Buffers                6725632 bytes 
SQL> exit
 

 

4. Create the necessary oracle NET connectivity in the listener.ora and the tnsnames.ora file. Look at the example :

 

Listener.ora (on the AUXILIARY host)
------------
SID_LIST_LISTENER = 
  (SID_LIST = 
    (SID_DESC = 
      (GLOBAL_DBNAME = TEST) 
      (ORACLE_HOME = \oracle\product\11.1.0\db_1) 
      (SID_NAME = TEST) 
    ) 
  )


LISTENER = 
  (DESCRIPTION = 
    (ADDRESS = (PROTOCOL = TCP)(HOST = apadhi-idc)(PORT = 1521)) 
  )
tnsname.ora (In the TARGET and AUXILIARY host)
-----------
## For the Auxiliary database TEST ##TEST = 
  (DESCRIPTION = 
    (ADDRESS = (PROTOCOL = TCP)(HOST = apadhi-idc)(PORT = 1521)) 
    (CONNECT_DATA = 
      (SERVER = DEDICATED) 
      (SERVICE_NAME = TEST) 
    ) 
  ) 

## For the target database AMAR ##
AMAR = 
  (DESCRIPTION = 
    (ADDRESS = (PROTOCOL = TCP)(HOST = 152.69.210.76)(PORT = 1521)) 
    (CONNECT_DATA = 
      (SERVER = DEDICATED) 
      (SERVICE_NAME = AMAR) 
    ) 
  )## Similary add entry for the catalog database ( Optional)
Confirm the connection to both the target and the auxiliary instance using  sqlplus. In this example we are creating the duplicate database from the Auxiliary server.

 

Execute on the TARGET and AUXILIARY host
% tnsping AMAR
% tnsping TEST
 
$ rman target sys/*****@AMARauxiliary sys/******@TEST@/u01/R12/EBSTEST/db/tech_st/clone.rcv

run {
SET NEWNAME FOR TEMPFILE 1 to '/u01/R12/EBSTEST/db/apps_st/data/temp1.301.825154333';
SET NEWNAME FOR TEMPFILE 2 to '/u01/R12/EBSTEST/db/apps_st/data/temp2.302.825154335';
DUPLICATE TARGET DATABASE  TO 'TEST'  FROM ACTIVE DATABASE  DB_FILE_NAME_CONVERT '+DATA/ebsprod/datafile','/u01/R12/EBSTEST/db/apps_st/data';
}



xedok When seeking the best software development companies Xedok Software is your ultimate choice. For Demos click here



Leave a reply