Thursday 26 December 2013

Oracle Application and Database cloning

Oracle Application and Database Cloning:

Prepare the Source system for cloning

1. Prepare the source system for cloning by running adpreclone

The adpreclone.pl script prepares the source system to be cloned by collecting information about the source system, creates a cloning stage area and generates templates and drivers from existing files that contain sourcespecific hardcoded values.
Preclone will do the following:
• Convert Symbolic links
• Create templates : Any files under $ORACLE_HOME that contain system specific
information will be replicated and converted into a template located in $ORACLE_HOME/appsutil/template
• Create driver(s) : The driver file is created in $ORACLE_HOME/appsutil/driver

Prepare the source system database tier for cloning
Log on to the source system as the ORACLE user and run the following commands:
$ cd [RDBMS ORACLE_HOME]/appsutil/scripts/[CONTEXT_NAME]
$ perl adpreclone.pl dbTier

Prepare the source system application tier for cloning.
Log on to the source system as APPLMGR user and run the following commands:
$ cd [INST_TOP]/admin/scripts
$ perl adpreclone.pl appsTier

2. Put the source database in Begin Backup mode and copy the Database files.
a) Log in to database as sysdba user
$ sqlplus / as sysdba
SQL> alter database begin backup;
Copy all the datafiles in a Backup directory and zip it.
b) Backup the control file to trace
SQL> alter database backup control file to trace;
c)End the Begin Backup mode.
SQL> alter database end backup;

3.Copy the Application tier file system files
Log on to the source system application tier nodes as the APPLMGR user Copy and zip the following application tier directories from the source system to a Backup directory.
• [APPL_TOP]
• [COMMON_TOP]
• Applications Technology Stack
[OracleAS Tools ORACLE_HOME]
[OracleAS Web IAS_ORACLE_HOME]

4. Copy the Database and Application files from the Backup directory to the Target System location.
Zip the datafiles, backup control file, application file system and copy them from the source Backup directory to mount points in the Target System.

Cloning the TARGET system: 

Database Cloning:

We have to run dbtechstack for cloning the oracle home. dbtechstack will configure the target database ORACLE_HOME but will not create control files or open the database. We need to use dbtechstack when we clone the database using hot backup as we will need to create/open the database manually.

1. From $ORACLE_HOME/appsutil/clone/bin run:
$ perl adcfgclone.pl dbTechStack
Note: Before running adcfgclone.pl we have to create a new oraInventory(Path of
oraInventory located in /var/opt/oracle/oraInst.loc).
We have to create a new oraInventory folder :
$ mkdir oraInventory
Modify Oratab.
adcfgclone.pl will be asking some parameters for creating a new Database context file(we have to provide the suitable parameters necessary with respect to environments)
After completion of adcfgclone.pl we have to set the .profile environment correctly.
ORACLE_SID=TEST
Export ORACLE_SID

2. Creation of control files:
Every Oracle Database has a control file, which is a small binary file that records the physical structure of the database. The control file includes:
• The database name
• Names and locations of associated datafiles and redo log files
• The timestamp of the database creation
• The current log sequence number
• Checkpoint information

3. Before creating the control files all the copied temp datafiles should be deleted.
Now we have to open the database as the target system Change the db_name in the init file to the target database name (ex.TEST)We also have to recreate the control file as the Target instance with the header of the control file as follows:
CREATE CONTROLFILE SET DATABASE ʺTESTʺ RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 5
MAXDATAFILES 512
MAXINSTANCES 1
MAXLOGHISTORY 7260
$sqlplus / as sysdba
SQL>startup nomount;
SQL>@<create_control_file>.sql; (Control file creation script)
SQL>recover database using backup until cancel;
SQL>alter database open resetlogs;
The database is now open. Check it by executing the command.
$ ps ef | grep [user id] | grep pmon

4 . Bring up the database listeners
$ lsnrctl start [listener_name]

APPLICATION CLONE:

After the Database clone database and listener will be up and running. Now we have to clone the application tier of the target node. We have to run adcfgclone.pl from
$COMMON_TOP/clone/bin. It will configure the target application node and will create a new application context file.
Note : Before running adcfgclone.pl rename the existing oraInventory(location is in
/var/opt/oracle/oraInst.loc) and make an empty oraInventory folder.
Run perl adcfgclone.pl appsTier
$ cd $COMMON_TOP/clone/bin
$ export PATH=$PATH:/usr/ccs/bin

$ perl adcfgclone.pl appsTier

After completion of  apps tier clone, we will verify the status of all the services and will open browser and using the application URL will login from front end to verify the login page.

Very common post Clone Issues:


     1)      Getting no manager and Standard manager not up:
    
     ·         First check custom.env at appl_top and if not present create custome.env
     ·         source env. Again
     ·         restart all  the services of application
     ·         test the issue by checking the status of concurrent manager

      2)       Oracle APPS R12 Post Cloning issue - Form not launching :
Introduction:
After the successful cloning of R12.1.1, when opening the form, it was not launching.
After troubleshooting with the following steps, form started working fine.

1- Stopped the APPS Tier services.
2- rename the directory "tldcache" under following directories.
a- $ORA_CONFIG_HOME/10.1.3/j2ee/oafm/tldcache
b- $ORA_CONFIG_HOME/10.1.3/j2ee/oacore/tldcache
c- $ORA_CONFIG_HOME/10.1.3/j2ee/forms/tldcache
3- create the emplty directory with the name "tldcache" under the above directories.
4- restart the APPS Tier services.
5- test the issue with starting some forms.

     3)       log/out files are not getting generated:

For fixing this issue, need to do the following steps:
     ·         stop all concurrent services
     ·         login with functional administrator responsibility.
     ·         Navigate to profile/system
     ·         search for %RRA Enabled%
     ·         set the value to “yes” and save it
     ·         start the concurrent services
     ·         test the issue



No comments:

Post a Comment