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
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.
oradim -new -sid dup
Orapwd file="c:\oracle\product\10.2.0\db_1\database\PWDdup.ora" password=sys_pwd entries=5
Add the following entry to listener.ora
(SID_DESC = (SID_NAME = DUP) (ORACLE_HOME = C:\oracle\product\10.2.0\db_1) )
Add the following entry to tnsnames.ora
DUP = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = host3)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = dup) ) )
Note: The auxiliary instance must be accessible via Net8. Before proceeding, use RMAN to ensure that you can establish a connection to the target database, the auxiliary instance, and the recovery catalog database.
In this example, the connection is established to three databases, all using net service names:
C:\> rman catalog rman/rman@catdb target sys/sys_pwd@orcl auxiliary sys/sys_pwd@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\')
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.
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.
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; }
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 |