Duplicate database by active RMAN in 11g Oracle

Duplicate Database by ACTIVE in RMAN

Target: Database to be cloned. (Source database – ORCL instance)
Auxiliary: Destination database to which the source database will be cloned (ORCLDUP instance)
 
1) Prepare Init.ora file for the auxiliary instance

*.db_name='ORCLDUP'
*.control_files='C:\ORACLE\ORADATA\ORCLDUP\control01.ctl,C:\ORACLE\ORADATA\ORCLDUP\control02.ctl'

2) Create Password file
Copy the password file to the target server, rename it in the below format, this is the easiest method;
you can always create the same with orapwd utility.
Unix Servers: orapw.ora
Windows Servers: PWD.ora
 
3) Create Oracle related services (Required for Oracle on Windows only)
Use Oradim utility to create an Oracle service on Windows servers, this step is not applicable for Unix servers.

oradim -new -sid orcldup -srvc oracleserviceorcldup

4) Create directories for database files
Create the required directories on the target server for datafiles, redo logs, control files, temporary files etc,
this example assumes that all the database files will be stored under ‘C:ORACLEORADATAORCLDUP’
 
5) Configure listener to user static service registration
Static service registration for the listener must be done on the target server,
this is because the database instance in NOMOUNT state (auxiliary instance before cloning) will not allow database connections,
it will be BLOCKED. To configure static service registration with the listener, update the listener.ora file as below.
Please note that, in this example the target and auxiliary instances are on the same server.

SID_LIST_LISTENER =
(SID_LIST = (SID_DESC =
(ORACLE_HOME = C:\oracle\product\11.1.0\db_1)
(SID_NAME = ORCL))
(SID_DESC = (ORACLE_HOME = C:oracle\product\11.1.0\db_1)
(SID_NAME = ORCLDUP))
)

6) Reload the listener

lsnrctl reload;

7) Start and verify the auxiliary instance
Start the auxiliary instance;
verify the parameters db_name and control_files.

SQL> show parameter db_name;
SQL> show parameter control_files;

8) Perform Oracle 11g Active database duplication

RMAN>
run {
SET NEWNAME FOR DATAFILE 1 TO 'C:\ORACLE\ORADATA\ORCLDUP\SYSTEM01.DBF';
SET NEWNAME FOR DATAFILE 2 TO 'C:\ORACLE\ORADATA\ORCLDUP\SYSAUX01.DBF';
SET NEWNAME FOR DATAFILE 3 TO 'C:\ORACLE\ORADATA\ORCLDUP\UNDOTBS01.DBF';
SET NEWNAME FOR DATAFILE 4 TO 'C:\ORACLE\ORADATA\ORCLDUP\USERS01.DBF';
SET NEWNAME FOR DATAFILE 5 TO 'C:\ORACLE\ORADATA\ORCLDUP\EXAMPLE01.DBF';
SET NEWNAME FOR TEMPFILE 1 TO 'C:\ORACLE\ORADATA\ORCLDUP\TEMP01.DBF';
duplicate target database to orcldup from active database;
}

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s