Monday, March 19, 2012

Step by step Hot Backup Cloning


Hot Backup Cloning


Assumptions:

1) Latest versions of Perl, JRE,JDK,ZIP utilities are available on source and target systems.
2) Latest AD Minipack is applied on Application Tier
3) Latest Autoconfig Template Patch and Latest RapidClone Patches are applied to Application Tier.
4) Source database is in Archive log mode. Ex: Alter database archivelog and Change log_archive_enable to TRUE in initSID.ora

Steps to do on Source System:

1) Log into Database Tier as DB user and run preclone.
Ex: cd $ORACLE_HOME/appsutil/scripts/CONTEXT NAME/   perl adpreclone.pl dbTier

2) Log into Application Tier as Apps user and run preclone.
Ex: cd $COMMON_TOP/admin/scripts/CONTEXT NAME/    perl adpreclone.pl appsTier

3) Place the database in Begin Backup Mode. Ex: alter database begin backup (10g onwards) or alter tablespace <tablespace name> begin backup(Prior to 10g)

4) Copy all the datafiles to Backup directory or to target system.
Note: Copying of control, log and temp file is not necessary.

5) Backup the control file to trace (located in udump) and copy it to Backup directory.
Ex: alter database backup control file to trace

6) Remove database from Begin Backup Mode. Ex: alter database end backup

7) Now copy DB_TOP as DB user to Backup directory or target system. (Take Backup of Archive logs also if they are located in some other place)

8) Next copy APPL_TOP, COMMON_TOP and ORA_TOP as Apps user to Backup directory or target system.

Steps to do on Target System:

1) Copy all the files from Backup Directory to this system under respective user groups and change the permissions for all the directories recursively.


2) Log into Database Tier as DB user and configure it.
Ex: cd $ORACLE_HOME/appsutil/clone/bin/   perl adcfgclone.pl dbTechStack


3) Create a control file manually from the file which we backed up from trace.  
a. Remove all lines before the startup nomount statement
b. Modify the REUSE to SET
c. Modify Source DB SID to Target SID (Here PROD to TEST)
d. Modify NORESETLOGS TO RESETLOGS
e. Delete all lines after the CHARACTER SET statement
f. Change the datafile locations according to their locations in target system.
Note: Save the file as an sql executable file with .sql extension.

4) Now modify the initSID.ora file accordingly for Target system and enable archive log mode in it.

5) Now start the database in nomount state. Ex: startup nomount pfile=”<initSID.ora location>”

6) Now run the modified control file (sql file). With this database will be in mount state.

7) After the database is mounted, execute recover command using backup control file.
Ex: recover database using backup controlfile until cancel

8) Now open the database. Ex: alter database open resetlogs

9) Now add a temp file to the target database.
Ex: 1) create temporary tablespace TEMP tempfile ‘<temp file location>’ size 50M        autoextend off.
Ex: 2) alter tablespace TEMP add tempfile ‘<temp file location>’ size 50M autoextend off

10) Log into the Application Tier as Apps user and configure it.
Ex :cd $COMMON_TOP/clone/bin/   perl adcfgclone.pl appsTier

Finishing tasks:

(1) Update Profile options
(2) Update Printer Settings
(3) Update the workflow configuration settings
(4) Verify the APPLCSF variable setting
(5) Update the session_cookie_domain value in icx_parameters

Log Files:
1) cd $ORACLE_HOME/appsutil/log/CONTEXT NAME/*.log
2) cd $APPPL_TOP/admin/CONTEXT NAME/log/*.log


No comments:

Post a Comment