Environment
OS: RHEL 5
Database Version : 11.2.0.1
ORACLE_HOME : /u01/CHARAN/oracle/11gR1/orahome (same for both target & auxiliary)
Target Details
DB Name : CHARAN
Instance Name : CHARAN
Listener Name : CHARAN
TNS Name for Auxiliary : TNS_DUPL
Auxiliary Details
DB Name : DUPL
Instance Name : DUPL
Listener Name : DUPL
TNS Name for Target : TNS_CHARAN
This type of duplication can be done in four phases
Phase One : Configure Network & Create Password Files
Phase Two : Create parameter file for Auxiliary and Start Auxiliary instance
Phase Three : Configure RMAN Parameters for Optimal Performance
Phase Four : Execute Duplicate Command
1. Check if the target database is in archive log mode
sqlplus / as sysdba
SQL> archive log list
2. Establish network connection
Since this is active duplication rman has to be connected through network on both the instances as the backup files will be transferred over network
If you issue OS authentication for connecting to auxiliary instance
Ex : rman target sys/sys@TNS_CHARAN auxiliary /
then the duplicate command fails stating connection has to be over network.
Navigate to $ORACLE_HOME/network/admin or any directory specified by environmental variable $TNS_ADMIN and edit listener.ora and tnsnames.ora files and start listeners
[oracle@dba01 admin]$ cat listener.ora
CHARAN =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dba01.charan.com)(PORT = 1521))
)
)
SID_LIST_CHARAN =
(SID_LIST =
(SID_DESC =
(ORACLE_HOME= /u01/CHARAN/oracle/11gR1/orahome)
(SID_NAME = CHARAN)
)
)
DUPL =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dba01.charan.com)(PORT = 1531))
)
)
SID_LIST_DUPL =
(SID_LIST =
(SID_DESC =
(ORACLE_HOME= /u01/CHARAN/oracle/11gR1/orahome)
(SID_NAME = DUPL)
)
)
[oracle@dba01 admin]$
[oracle@dba01 admin]$ cat tnsnames.ora
TNS_CHARAN = (DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=dba01)(PORT=1521))
(CONNECT_DATA=(SID=CHARAN))
)
TNS_DUPL = (DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=dba01)(PORT=1531))
(CONNECT_DATA=(SID=DUPL))
)
[oracle@dba01 admin]$
3. Create password files for both the instances
Since rman connects as sysuser over network, password files should be created on both the instances
Set the environments for appropriate instances and create password files
orapwd file=orapw$ORACLE_SID password=sys force=y
4. Copy the target parameter file to create a new parameter file for Auxiliary
cp initCHARAN.ora initDUPL.ora
The following changes are to be done
db_name
control_files directory to new directory
log_archive_dest to new directory
db_file_name_convert=<old location>,<new location> (To convert database file names on auxiliary)
log_file_name_convert=<old location>,<new location> (To convert log file names on auxiliary)
db_files=<same_number_as_in_target>
[oracle@dba01 dbs]$ cat initDUPL.ora
db_name='DUPL'
sga_target=1G
sga_max_size=2G
processes = 150
db_files=512
audit_trail ='db'
db_block_size=8192
diagnostic_dest='/u01/CHARAN/oracle/11gR1/orabase'
open_cursors=300
remote_login_passwordfile='EXCLUSIVE'
undo_tablespace='UNDOTBS1'
control_files = (/u01/CHARAN/oracle/11gR1/DUPL/oradata/control01.ctl)
compatible ='11.1.0'
log_archive_dest='/u01/CHARAN/oracle/11gR1/DUPL/oradata/arch'
db_file_name_convert='/u01/CHARAN/oracle/11gR1/oradata','/u01/CHARAN/oracle/11gR1/DUPL/oradata'
log_file_name_convert='/u01/CHARAN/oracle/11gR1/oradata','/u01/CHARAN/oracle/11gR1/DUPL/oradata'
[oracle@dba01 dbs]$
5. Start Auxiliary instance
source db_DUPL.env
sqlplus / as sysdba
startup nomount;
6. We can configure channels at target to optimize performance, but I left with default values
7. At auxiliary/target execute the command
rman target sys/sys@TNS_CHARAN auxiliary sys/sys@TNS_DUPL
RMAN> duplicate target database to DUPL from active database;
That's it!!!
Regards
Charan