Friday, November 30, 2012

Duplicate the Database W/O connecting to Production Database.

There is a new feature in Oracle 11g where you can create a duplicate database of Production database without connecting to Production or Catalog Database.

In this post I'll show you how to create the same.

Here Primary Database is DB1 and Duplicate Database is DB2.
 
I've followed the below steps to creating the duplicate database.

1. Configured the listener and tns files on both the servers.
2. Created parameter file and Oracle Password file. 
3. Took the Primary Database full backup including current control file and archive logs.
4. Created the directories over duplicate database server like for audit, dbs, network, backup directory and its sub-directories viz., autobackup, backupset, archivelog etc.
5. Copied all the backupset to the directory named "/u01/bkp" and Oracle Physical files to the duplicate DB server. 
6. Changed the parameter file for duplicate database.
7. Made an entry for the duplicate database in "/etc/oratab" file. 
8. Started the duplicate database in nomount mode using its pfile.
9. With RMAN prompt, I run the duplicate command to create the Duplicate database.

@db1
parameter file  
listener
tnsnames.ora

@db2
parameter file
listener
tnsnames.ora


























[oracle@db2 dbs]$ mv initdb1.ora initdb2.ora

edit the parameter file for duplicate database. For this I've opened the parameter file in vi editor then replace the "db1" by "db2" wherver it was.





Made an entry for database "db2" in "/etc/oratab" file by "oracle" user.




No comments:

Post a Comment