Sunday, 24 June 2018

Cloning database with RMAN

Below are the steps to clone production database(primedb) to UAT database(clonedb)
 
STEP1:- Check the both servers are able to connect each-other
STEP2:- Take full database backup and control file backup in primary database using RMAN.
STEP3:- Create same backup directory in clone database server and copy RMAN backup pieces from primary database server.
STEP4:- Create PFILE from SPFILE and copy it into cloned server to $ORACLE_HOME/dbs/ location.
STEP5:- Open pfile in cloned server and make following changes:
a) Change primary database name with clone database name
b) Add "db_file_name_convert" and "log_file_name_convert" parameters to pfile
STEP6:- Create all required directories in cloned server mentioned in pfile:
STEP7:- Create clonedb entry in /etc/oratab file.
STEP8:- Set oracle environment to "clonedb" in .bash_profile
STEP9:- Login to sqlplus and start up the database with nomount.This will start an auxiliary instance for clonedb database.
STEP10:- Connect RMAN in cloned server and follow below steps

$rman
RMAN> connect auxiliary /
RMAN> connect target sys/sys@primdb
RMAN> run
2> {
3> allocate auxiliary channel c1 device type disk;
4> allocate channel c2 device type disk;
5> duplicate target database to 'clonedb';
6> }

Harry

Author & Editor

A technology enthusiast and addictive blogger who likes to hacking tricks and wish to be the best White Hacket Hacker of the World.

0 comments:

Post a Comment

Note: only a member of this blog may post a comment.