Duplicate database from active database

— Source database     = TRAC
— Duplicate database = TDUP10

##############################
## PREREQUISITES for Cloning
##############################

## Create the diag structure
 mkdir -p <diag_directory_DB_Name>
## Generate the PFILE from the Original DB and copy to the target host:
 alter system create pfile'/tmp/pfile.ora' from spfile;
 scp /tmp/pfile.ora lclus01:/tmp
## Adjust the following pfile parameters:
 DB_NAME
 LOG_FILE_NAME_CONVERT
 DB_FILE_NAME_CONVERT
 DB_CREATE_FILE_DEST
##Statup nomount and create the spfile:
 alter system create spfile='+DATA/TDUP10/spfile_TDUP10.ora' from pfile'/tmp/pfile.ora';
#############################################################
##############################
 Network Configuration
 ##############################
##Listener Static Entry:
 SID_LIST_LISTENER =
 (SID_LIST =
 (SID_DESC =
 (SID_NAME = PLSExtProc)
 (ORACLE_HOME = /u01/oracle/product/11.2.0.1)
 (PROGRAM = extproc)
 )
 (SID_DESC =
 (global_dbname = TDUP10.emilianofusaglia.net)
 (ORACLE_HOME = /u01/oracle/product/11.2.0.1)
 (sid_name = TDUP11)
 )
 )
##TNS entry
 TDUP10.emilianofusaglia.net =
 (DESCRIPTION =
 (ADDRESS = (PROTOCOL = TCP)(HOST = loraclu-scan.emilianofusaglia.net)(PORT = 1526))
 (CONNECT_DATA =
 (SERVER = DEDICATED)
 (SERVICE_NAME = TDUP10.emilianofusaglia.net)
 )
 )
#############################################################
##############################
 ##RMAN Duplicate
 ##############################
#rman
 connect target /
 connect auxiliary sys/xxxxx@TDUP10.emilianofusaglia.net
 duplicate target database
 to TDUP10
 from active database
 DB_FILE_NAME_CONVERT 'TRAC','TDUP10'
 skip tablespace POR_READONLY;
##Register the database into the Grid Infrastructure
 srvctl add database -d TDUP10 -o $ORACLE_HOME
 srvctl add instance -d TDUP10 -i TDUP11 -n lclus01
 srvctl add instance -d TDUP10 -i TDUP12 -n lclus02
##Create the password file on each node using the utility orapwd.
 #cd $ORACLE_HOME/dbs
 #orapwd file=<password_file_name> password=<sys_password> entries=n
## Add oratab entry
 <DB_NAME>:<ORACLE_HOME>:N
Advertisements

2 thoughts on “Duplicate database from active database

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s