Search Blog Post

Monday, December 9, 2013

Cloning Oracle Applications 11i instance




Cloning creates an identical copy of an existing Oracle Application System. There are various reasons for cloning such as:-
  - Changing the Oracle APPS architecture (adding a node to the system)
  - Migrating an existing system to new hardware
  - Creating a copy of the production system for testing, development 
  - Creating a stage area to reduce patching downtime

·     Verify source and target nodes software versions (if is not done already)
·     Apply the latest AD Minipack (if is not done already)
·     Apply the latest AutoConfig Template patch (if is not done already)
·     Apply the latest Rapid Clone patches (if is not done already)
·     Setup Rapid Clone on the Applications Tier (if is not done already)
·     Setup Rapid Clone on the Database Tier (if is not done already)
·     Maintain Snapshot information

Prepare the Source System
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 dbTechStack


Prepare the source system application tier for cloning 
Log on to the source system as the APPLMGR user and run the following commands on each node that contains an APPL_TOP:

cd <COMMON_TOP>/admin/scripts/<CONTEXT_NAME>
perl adpreclone.pl appsTier 


In our case the steps to prepare source system for cloning are executed successfully.


 Configure the target System
Ø  Login as oraDEV or root user in gddevdb1.tireco.com(Target System)
gddevdb1:/home/oraDEV>pwd
/home/oraDEV       
gddevdb1:/home/oraDEV>id
uid=502(oraDEV) gid=501(dba) groups=100(users),501(dba)

Ø  restore oracle home binaries from production backup
cd /mnt/DEVapps/
gddevdb1:/mnt/DEVapps>pwd
/mnt/DEVapps
Ø  location of production backup tar file.
gddevdb1:/home/oraDEV>cd /backups/PRDapps
gddevdb1:/backups/PRDapps>ls -lrt
total 39723644
-rw-rw-rw-+ 1 oraDEV dba  4509339132 Nov 14 13:40 trcprddb_141112.tar.gz
-rw-rw-rw-+ 1 oraDEV dba  4256675125 Nov 16 07:48 trcappl_161112.tar.gz
-rw-rw-rw-+ 1 oraDEV dba  2743689602 Nov 16 09:54 trcora_161112.tar.gz
-rw-rw-rw-+ 1 oraDEV dba  1388677554 Nov 16 09:56 trccomn_161112.tar.gz
-rw-rw-rw-+ 1 oraDEV dba  4269966444 Nov 28 17:07 trcappl_281112.tar.gz
-rw-rw-rw-+ 1 oraDEV dba  2744646251 Nov 28 17:20 trcora_281112.tar.gz
-rw-rw-rw-+ 1 oraDEV dba  1382274968 Nov 28 17:23 trccomn_281112.tar.gz
drwxrwxrwx+ 2 oraDEV dba        4096 Dec 30 19:04 TRCTST
-rw-rw-rw-+ 1 oraDEV dba 17362330841 Jan 30 01:56 PRDapps.tar.gz
-rw-rw-rw-+ 1 oraDEV dba  2019344384 Jan 30 08:25 trcprddb_300113.tar.gz

Ø  location of production backup tar file.
gddevdb1:/home/oraDEV>cd /backups/PRDapps
gddevdb1:/backups/PRDapps>ls -lrt
total 39723644
-rw-rw-rw-+ 1 oraDEV dba  4509339132 Nov 14 13:40 trcprddb_141112.tar.gz
-rw-rw-rw-+ 1 oraDEV dba  4256675125 Nov 16 07:48 trcappl_161112.tar.gz
-rw-rw-rw-+ 1 oraDEV dba  2743689602 Nov 16 09:54 trcora_161112.tar.gz
-rw-rw-rw-+ 1 oraDEV dba  1388677554 Nov 16 09:56 trccomn_161112.tar.gz
-rw-rw-rw-+ 1 oraDEV dba  4269966444 Nov 28 17:07 trcappl_281112.tar.gz
-rw-rw-rw-+ 1 oraDEV dba  2744646251 Nov 28 17:20 trcora_281112.tar.gz
-rw-rw-rw-+ 1 oraDEV dba  1382274968 Nov 28 17:23 trccomn_281112.tar.gz
drwxrwxrwx+ 2 oraDEV dba        4096 Dec 30 19:04 TRCTST
-rw-rw-rw-+ 1 oraDEV dba 17362330841 Jan 30 01:56 PRDapps.tar.gz
-rw-rw-rw-+ 1 oraDEV dba  2019344384 Jan 30 08:25 trcprddb_300113.tar.gz

Ø  Rename trcprddb to trcdevdb
gddevdb1:/mnt/DEVapps/oracle>mv trcprddb trcdevdb
gddevdb1:/mnt/DEVapps/oracle>ls -lrt
total 8
drwxr-xr-x 3 oraDEV dba 4096 Aug 30 19:02 trcdevdb
-rwxrwxr-x 1 oraDEV dba  145 Dec 19 15:22 cp_db.sh

Ø  rapid clone ( adcfgclone.pl with dbTechStack) {when cloning DB from hot backup we use dbTechStack feature, it will configure the target database ORACLE_HOME but it will not create control files or open the database}
gddevdb1:/mnt/DEVapps/oracle/trcdevdb/11.2.0/dbhome_1/appsutil/clone/bin>perl adcfgclone.pl dbTechStack
Enter the APPS password [APPS]:
apps

First Creating a new context file for the cloned system.
The program is going to ask you for information about the new system:


Provide the values required for creation of the new Database Context file.

Do you want to use a virtual hostname for the target node (y/n) [n] ?:

Target instance is a Real Application Cluster (RAC) instance (y/n) [n]:

Target System database name [TRCPRD]:TRCDEV

Target system RDBMS ORACLE_HOME directory [/mnt/PRDapps/oracle/trcprddb/11.2.0/dbhome_1]:/mnt/DEVapps/oracle/trcdevdb/11.2.0/dbhome_1

Target system utl_file accessible directories list [/usr/tmp]:

Number of DATA_TOP's on the target system [1]:

Target system DATA_TOP 1 [/mnt/PRDdata/trcprd]:/mnt/DEVdata/trcdev

Do you want to preserve the Display set to gdprddb1:1.0 (y/n) [y] ?:n

Target system Display [gddevdb1:0.0]:gddevdb1:1.0

Perl executable location is set to:
/usr/bin/perl

Do you want to preserve the port values from the source system on the target system (y/n) [y] ?:n

Clone Context uses the same port pool mechanism as the Rapid Install
Once you choose a port pool, Clone Context will validate the port availability.

Enter the port pool number [0-99]:
60

Checking the port pool 60
done: Port Pool 60 is free
Database port is 1581

Creating the new Database Context file from :
  /mnt/DEVapps/oracle/trcdevdb/11.2.0/dbhome_1/appsutil/template/adxdbctx.tmp

The new database context file has been created :
  /mnt/DEVapps/oracle/trcdevdb/11.2.0/dbhome_1/appsutil/TRCDEV_gddevdb1.xml

Log file located at /tmp/CloneContext_0130092719.log

Running Rapid Clone with command:
        perl /mnt/DEVapps/oracle/trcdevdb/11.2.0/dbhome_1/appsutil/clone/bin/adclone.pl java=/mnt/DEVapps/oracle/trcdevdb/11.2.0/dbhome_1/appsutil/clone/bin/../jre/jre mode=apply stage=/mnt/DEVapps/oracle/trcdevdb/11.2.0/dbhome_1/appsutil/clone/bin/.. component=dbTechStack method=CUSTOM dbctxtg=/mnt/DEVapps/oracle/trcdevdb/11.2.0/dbhome_1/appsutil/TRCDEV_gddevdb1.xml  showProgress contextValidated=true
Beginning rdbms home Apply - Wed Jan 30 09:32:24 2013
Log file located at /mnt/DEVapps/oracle/trcdevdb/11.2.0/dbhome_1/appsutil/log/TRCDEV_gddevdb1/ApplyDBTechStack_01300932.log


Completed Apply...
Wed Jan 30 09:33:26 2013

Beginning APPSDB_TRCDEV registration to central inventory...

ORACLE_HOME NAME   : APPSDB_TRCDEV
ORACLE_HOME PATH   : /mnt/DEVapps/oracle/trcdevdb/11.2.0/dbhome_1
Using Inventory location in /etc/oraInst.loc
Log file located at /etc/oracle/oraInventory/logs/OracleHomeCloner_01300933.log

ERROR: Registration Failed... Please check log file.

You can rerun this registration with the following script:
        /mnt/DEVapps/oracle/trcdevdb/11.2.0/dbhome_1/appsutil/out/TRCDEV_gddevdb1/regOUI_APPSDB_TRCDEV.sh

Starting database listener for TRCDEV:
Running:
 /mnt/DEVapps/oracle/trcdevdb/11.2.0/dbhome_1/appsutil/scripts/TRCDEV_gddevdb1/addlnctl.sh start TRCDEV

You are running addlnctl.sh version 115.7

Logfile: /mnt/DEVapps/oracle/trcdevdb/11.2.0/dbhome_1/appsutil/log/TRCDEV_gddevdb1/addlnctl.txt

Starting listener process TRCDEV ...
addlnctl.sh: exiting with status 0


Ø  clone the database using rman duplicate command (we are using rman dupliate command to create database)
gddevdb1:/home/oraDEV>vi rman_dup.sh
export NLS_DATE_FORMAT='DD-MON-RR HH24:MI:SS'
export dt=`date +%m%d%y%H%M`

rman target=sys/{Passwd}@TRCTST log=dup_TRCDEV_${dt}.log auxiliary=/ <<!
run{
set until time "to_date('2013 jan 31 17:50','yyyy mon dd hh24:mi')";
allocate auxiliary channel C1 device type disk;
allocate auxiliary channel C2 device type disk;
allocate auxiliary channel C3 device type disk;
allocate auxiliary channel C4 device type disk;
set newname for tempfile 1 to '/mnt/DEVdata/trcdev/temp01.dbf';
set newname for tempfile 2 to '/mnt/DEVdata/trcdev/temp02.dbf';
set newname for tempfile 3 to '/mnt/DEVdata/trcdev/temp03.dbf';
set newname for tempfile 4 to '/mnt/DEVdata/trcdev/temp05.dbf';
set newname for tempfile 5 to '/mnt/DEVdata/trcdev/hsoetemp01.dbf';
set newname for tempfile 6 to '/mnt/DEVdata/trcdev/hsoetemp02.dbf';
set newname for tempfile 7 to '/mnt/DEVdata/trcdev/hsoetemp03.dbf';
set newname for tempfile 8 to '/mnt/DEVdata/trcdev/hsoetemp05.dbf';
duplicate target database to TRCDEV
LOGFILE
GROUP  1 ('/mnt/DEVdata/trcdev/redo01a.log','/mnt/DEVdata/trcdev/redo01b.log') SIZE 120 M  REUSE,
GROUP  2 ('/mnt/DEVdata/trcdev/redo02a.log','/mnt/DEVdata/trcdev/redo02b.log') SIZE 120 M  REUSE,
GROUP  3 ('/mnt/DEVdata/trcdev/redo03a.log','/mnt/DEVdata/trcdev/redo03b.log') SIZE 120 M  REUSE
nofilenamecheck;
}

gddevdb1:/home/oraDEV>nohup ./rman_dup.sh &

Database created successfully.
Cat the log file to check if there are any errors.
Once the DB is created successfully run fnd_clean.sql { this fnd_clean.sql will clean up the  source node}
gddevdb1: /home/oraDEV>sqlplus '/as sysdba'
SQL>@/home/oraDEV/clone/fnd_clean.sq
once this PL/SQL procedure is successfully completed you have to adupdlib.sql
Run the Library update script against database
cd [RDBMS ORACLE_HOME]/appsutil/install/[CONTEX_NAME]
sqlplus "/as sysdba" @adupdlib.sql [libext]
where libext should be set 'sl' for HP-UX, 'so' for any other UNIX platform or 'dll' for Windows
gddevdb1:/mnt/DEVapps/oracle/trcdevdb/11.2.0/dbhome_1/appsutil/install/TRCDEV_gddevdb1>ls -lrt adupdlib*
-rw------- 1 oraDEV dba 2001 Feb  1 10:19 adupdlib.sql
gddevdb1:/mnt/DEVapps/oracle/trcdevdb/11.2.0/dbhome_1/appsutil/install/TRCDEV_gddevdb1
sqlplus "/as sysdba" @adupdlib.sql sl

SQL*Plus: Release 11.2.0.3.0 Production on Fri Feb 1 10:11:55 2013

Copyright (coffee) 1982, 2011, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

PL/SQL procedure successfully completed.
SQL> commit;

After running both these fnd_clean.sql and adupdlib.sql you have to run autoconfig on dbTier
gddevdb1:/mnt/DEVapps/oracle/trcdevdb/11.2.0/dbhome_1/appsutil/scripts/TRCDEV_gddevdb1>ls -lrt adautocfg.sh
-rwx------ 1 oraDEV dba 1512 Feb  1 10:19 adautocfg.sh
gddevdb1:/mnt/DEVapps/oracle/trcdevdb/11.2.0/dbhome_1/appsutil/scripts/TRCDEV_gddevdb1>./adconfig.sh
Enter the full path to the Context file: /mnt/DEVapps/oracle/trcdevdb/11.2.0/dbhome_1/appsutil/TRCDEV_gddevdb1.xml
Enter the APPS user password:
The log file for this session is located at: /mnt/DEVapps/oracle/trcdevdb/11.2.0/dbhome_1/appsutil/log/TRCDEV_gddevdb1/02011018/adconfig.log

AutoConfig is configuring the Database environment...

AutoConfig will consider the custom templates if present.
        Using ORACLE_HOME location : /mnt/DEVapps/oracle/trcdevdb/11.2.0/dbhome_1
        Classpath                   : /mnt/DEVapps/oracle/trcdevdb/11.2.0/dbhome_1/jdk/jre/lib/rt.jar:/mnt/DEVapps/oracle/trcdevdb/11.2.0/dbhome_1/jdk/lib/dt.jar:/mnt/DEVapps/oracle/trcdevdb/11.2.0/dbhome_1/jdk/lib/tools.jar:/mnt/DEVapps/oracle/trcdevdb/11.2.0/dbhome_1/jdbc/lib/ojdbc5.jar:/mnt/DEVapps/oracle/trcdevdb/11.2.0/dbhome_1/appsutil/java/xmlparserv2.zip:/mnt/DEVapps/oracle/trcdevdb/11.2.0/dbhome_1/appsutil/java:/mnt/DEVapps/oracle/trcdevdb/11.2.0/dbhome_1/jlib/netcfg.jar

        Using Context file          : /mnt/DEVapps/oracle/trcdevdb/11.2.0/dbhome_1/appsutil/TRCDEV_gddevdb1.xml

Context Value Management will now update the Context file

        Updating Context file...COMPLETED

        Attempting upload of Context file and templates to database...COMPLETED

Updating rdbms version in Context file to db112
Updating rdbms type in Context file to 64 bits
Configuring templates from ORACLE_HOME ...

AutoConfig completed successfully.



Ø  Copying trcappl top
                tar -zcvf /backups/PRDapps/TRCTST/trcappl_${dt}.tar.gz trcappl

Ø  Copying trccomn top
                tar -zcvf /backups/PRDapps/TRCTST/trccomn_${dt}.tar.gz trccomn

Ø  Copying trcora top
                tar -zcvf /backups/PRDapps/TRCTST/trcora_${dt}.tar.gz trcora


Ø  Restore appl top
                tar -zxvf /backups/PRDapps/TRCTST/trcappl_010213.tar.gz

Ø   Restore comn top

tar -zxvf /backups/PRDapps/TRCTST/trccomn_010213.tar.gz


Ø  Restore ora top

tar -zxvf /backups/PRDapps/TRCTST/trcora_010213.tar.gz

Ø  Rapid clone steps (adcfgclone.pl appsTier)
Configure target system Application Tier Server node
oraDEV@gddevap1:/mnt/DEVapps/oracle/trcdevdb/11.2.0/dbhome_1/appsutil/clone/bin ->
oraDEV@gddevap1:/mnt/DEVapps/trccomn/clone/bin ->perl adcfgclone.pl appsTier
Enter the APPS password [APPS]:
apps

First Creating a new context file for the cloned system.
The program is going to ask you for information about the new system:


Provide the values required for creation of the new APPL_TOP Context file.

Do you want to use a virtual hostname for the target node (y/n) [n] ?:

Target system database SID [TRCTST]:TRCDEV

Target system database server node [gdtstdb1]:gddevdb1

Target system database domain name [tireco.com]:

Does the target system have more than one application tier server node (y/n) [y] ?:

Does the target system application tier utilize multiple domain names (y/n) [n] ?:

Target system database server node [gdtstdb1]:gddevdb1

Target system database domain name [tireco.com]:

Does the target system have more than one application tier server node (y/n) [y] ?:

Does the target system application tier utilize multiple domain names (y/n) [n] ?:

Target system concurrent processing node [gdtstap1]:gddevcm1

Target system administration node [gdtstap1]:gddevap1

Target system forms server node [gdtstap1]:gddevap1

Target system web server node [gdtstap1]:gddevap1

Is the target system APPL_TOP divided into multiple mount points (y/n) [n] ?:

Target system APPL_TOP mount point [/mnt/PRDapps/trcappl]:/mnt/DEVapps/trcappl

Target system COMMON_TOP directory [/mnt/PRDapps/trccomn]:/mnt/DEVapps/trccomn

Target system 8.0.6 ORACLE_HOME directory [/mnt/PRDapps/trcora/806]:/mnt/DEVapps/trcora/806

Target system iAS ORACLE_HOME directory [/mnt/PRDapps/trcora/iAS]:/mnt/DEVapps/trcora/iAS

Do you want to preserve the Display set to gdtstap1:1.0 (y/n) [y] ?:n

Target system Display [gddevap1:0.0]:gddevap1:1.0

Location of the JDK on the target system [/usr/java/jdk1.6.0_32]:

Target system JRE_TOP [/usr/java/jdk1.6.0_32]:

Do you want to preserve the port values from the source system on the target system (y/n) [y] ?:n
Clone Context uses the same port pool mechanism as the Rapid Install
Once you choose a port pool, Clone Context will validate the port availability.

Enter the port pool number [0-99]:
60

Checking the port pool 60
done: Port Pool 60 is free

Complete port information available at /mnt/DEVapps/trcappl/admin/out/TRCDEV_gddevap1/portpool.lst

Verifying Database Connection...

Database Connection on Port 1581: Successful

UTL_FILE_DIR on database tier consists of the following directories.

1. /usr/tmp
2. /mnt/DEVapps/trcdevdb/10.2.0/appsutil/outbound/TRCDEV_gddevdb1
3. /usr/tmp
4. /mnt/DEVapps/trcappl/tir/11.5.0/edi_in
5. /mnt/DEVapps/trcappl/tir/11.5.0/edi_out
6. /mnt/DEVapps/trcappl/tir/11.5.0/edi_arch
7. /mnt/DEVapps/trcappl/tir/11.5.0/sz_out
8. /mnt/DEVapps/trcappl/tir/11.5.0/logility_out/daily
9. /mnt/DEVapps/trcappl/tir/11.5.0/logility_out/monthly
10. /mnt/DEVapps/trcappl/tir/11.5.0/tbc_archive
11. /mnt/DEVapps/trcappl/tir/11.5.0/tbc_out
12. /mnt/DEVapps/trcappl/tir/11.5.0/ups
13. /mnt/DEVapps/trcappl/tir/11.5.0/ups_arch
14. /mnt/DEVapps/trcappl/tir/11.5.0/bkup
15. /mnt/DEVapps/trcappl/tir/11.5.0/logility_out/daily_rp
Choose a value which will be set as APPLPTMP value on the target node [1]:
Creating the new APPL_TOP Context file from :
  /mnt/DEVapps/trcappl/ad/11.5.0/admin/template/adxmlctx.tmp

The new APPL_TOP context file has been created :
  /mnt/DEVapps/trcappl/admin/TRCDEV_gddevap1.xml

Log file located at /tmp/CloneContext_0201123409.log

Running Rapid Clone with command:
        perl /mnt/DEVapps/trccomn/clone/bin/adclone.pl java=/mnt/DEVapps/trccomn/clone/bin/../jre mode=apply stage=/mnt/DEVapps/trccomn/clone/bin/.. component=appsTier method=CUSTOM appctxtg=/mnt/DEVapps/trcappl/admin/TRCDEV_gddevap1.xml  showProgress contextValidated=true

Beginning application tier Apply - Fri Feb  1 12:51:03 2013
Log file located at /mnt/DEVapps/trcappl/admin/TRCDEV_gddevap1/log/ApplyAppsTier_02011251.log
Completed Apply...
Fri Feb  1 12:58:07 2013

Beginning APPSIAS_TRCDEV registration to central inventory...

ORACLE_HOME NAME   : APPSIAS_TRCDEV
ORACLE_HOME PATH   : /mnt/DEVapps/trcora/iAS
Using Inventory location in /etc/oraInst.loc
Log file located at /etc/oraInventory/logs/OracleHomeCloner_02011258.log
ORACLE_HOME /mnt/DEVapps/trcora/iAS was registered successfully.

Starting application Services for TRCDEV:
Running:
 /mnt/DEVapps/trccomn/admin/scripts/TRCDEV_gddevap1/adstrtal.sh apps/<appspwd>

You are running adstrtal.sh version 115.19

Executing service control script:
/mnt/DEVapps/trccomn/admin/scripts/TRCDEV_gddevap1/adapcctl.sh start
script returned:
****************************************************

adapcctl.sh version 115.55

Apache Web Server Listener is not running.
Starting Apache Web Server Listener (dedicated HTTP) ...
Apache Web Server Listener (PLSQL) is not running.
Starting Apache Web Server Listener (dedicated PLSQL) ...

adapcctl.sh: exiting with status 0


.end std out.

.end err out.

****************************************************


Executing service control script:
/mnt/DEVapps/trccomn/admin/scripts/TRCDEV_gddevap1/adalnctl.sh start
script returned:
****************************************************

adalnctl.sh version 115.17

Checking for FNDFS executable.
Starting listener process APPS_TRCDEV.

adalnctl.sh: exiting with status 0


.end std out.

.end err out.

****************************************************


Executing service control script:
/mnt/DEVapps/trccomn/admin/scripts/TRCDEV_gddevap1/adfrmctl.sh start
script returned:
****************************************************

You are running adfrmctl.sh version 115.38

Starting forms server for TRCDEV on port 9060.

adfrmctl.sh: exiting with status 0


.end std out.

.end err out.

****************************************************


Executing service control script:
/mnt/DEVapps/trccomn/admin/scripts/TRCDEV_gddevap1/adfmcctl.sh start
script returned:
****************************************************

You are running adfmcctl.sh version 115.20

Starting forms load balancing client for TRCDEV.

adfmcctl.sh: exiting with status 0


.end std out.

.end err out.

****************************************************


Executing service control script:
/mnt/DEVapps/trccomn/admin/scripts/TRCDEV_gddevap1/adfmsctl.sh start
script returned:
****************************************************

You are running adfmsctl.sh version 115.16

starting forms  metrics server for TRCDEV.

adfmsctl.sh: exiting with status 0


.end std out.

.end err out.

****************************************************


All enabled services for this node are started.
Check logfile /mnt/DEVapps/trccomn/admin/log/TRCDEV_gddevap1/02011258.log for details

Exiting with status 0



Post Clone steps after runnning "adcfgclone.pl appsTier"


1. Change Sysadmin password, it should not be similar to source system.

2. Check for custom top  in $APPL_TOP/customTRCTST2_oracle-2.env  , if this file is not there then create it.

3. Change the system profile for application site name (query profile %Site%Name%)

4. Update %BNE%Physical% profile setting 
{login to application as sysadmin user-> select sysadminitrator responsibility->click on profiles->enter %BNE%Physical% in the profile name field and update the value to point to correct path}

5. Update workflow mailer 
{update wf_notifications set MAIL_STATUS='SENT' where MAIL_STATUS='MAIL';
update wf_notifications set STATUS='CLOSED' where MAIL_STATUS='OPEN';}

6. Login to forms and run active user report

7. One can use sql to select from fnd_profile_option_values and see if anything is still pointing to source system.


No comments:

Post a Comment