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';
}