Tuesday, September 26, 2017

Hot Cloning EBS R12.2.4 by using RMAN and dualfs

 Cloning EBS R12.2.4 dbiter by using RMAN backup and application tier by dualfs

CLONING DB TIER

v  Run the preclone script on db tier and take the full backup of following except the data folder from source system…(/u01/JTCPROD/ora_prod)

v  11204     admin  cfgtoollogs  checkpoints  data  diag  oradata  oraInventory  scripts

v  Delete the all the files from oraInventory.(make sure you have created the inventory location /etc/oraInst.loc )

v  Copy the RMAN backup and $O_H files to specific folders on target system
o    (eg : /u01/JTCDEV/ora_dev and /u01/RMANBKP)

v  Change the permissions and ownership of the files.


1. Configure the database Oracle Home.
$ cd <RDBMS ORACLE_HOME>/appsutil/clone/bin
$ perl adcfgclone.pl dbTechStack

[oradev@dev1224 ~]$ export PATH=/u01/JTCDEV/ora_dev/11204/perl/bin:$PATH
[oradev@dev1224 ~]$ export PERL5LIB=/u01/JTCDEV/ora_dev/11204/perl/lib/5.10.0
[oradev@dev1224 ~]$ export PATH=/u01/JTCDEV/ora_dev/11204/bin:$PATH
[oradev@dev1224 ~]$ cd /u01/JTCDEV/ora_dev/11204/appsutil/clone/bin
[oradev@dev1224 bin]$ perl adcfgclone.pl dbTechStack

                     Copyright (c) 2002, 2015 Oracle Corporation
                        Redwood Shores, California, USA
                        Oracle E-Business Suite Rapid Clone
                                 Version 12.2
                      adcfgclone Version 120.63.12020000.56

Enter the APPS password :

Running: Context clone...

Log file located at /u01/JTCDEV/ora_dev/11204/appsutil/clone/bin/CloneContext_0916185106.log

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

Target System Hostname (virtual or normal) [dev1224] : dev1224.xxxx.com

Target Instance is RAC (y/n) [n] : n

Target System Database SID : DEV2

Target System Base Directory : /u01/JTCDEV/ora_dev

Target System utl_file_dir Directory List : /usr/tmp

Number of DATA_TOP's on the Target System [1] :

Target System DATA_TOP Directory 1 [/u01/JTCDEV/ora_dev/data] :

Target System RDBMS ORACLE_HOME Directory [/u01/JTCDEV/ora_dev/11.2.0] : /u01/JTCDEV/ora_dev/11204

Do you want to preserve the Display [proddb122:0.0] (y/n)  : n

Target System Display [dev1224:0.0] :

Do you want the target system to have the same port values as the source system (y/n) [y] ? : n

Target System Port Pool [0-99] : 66

Checking the port pool 66
done: Port Pool 66 is free
Report file located at /u01/JTCDEV/ora_dev/11204/appsutil/temp/portpool.lst
The new database context file has been created :
  /u01/JTCDEV/ora_dev/11204/appsutil/DEV2_dev1224.xml
Check Clone Context logfile /u01/JTCDEV/ora_dev/11204/appsutil/clone/bin/CloneContext_0916185106.log for details.

Running Rapid Clone with command:

Running:
perl /u01/JTCDEV/ora_dev/11204/appsutil/clone/bin/adclone.pl java=/u01/JTCDEV/ora_dev/11204/appsutil/clone/bin/../jre mode=apply stage=/u01/JTCDEV/ora_dev/11204/appsutil/clone component=dbTechStack method=CUSTOM dbctxtg=/u01/JTCDEV/ora_dev/11204/appsutil/DEV2_dev1224.xml showProgress contextValidated=true


Beginning rdbms home Apply - Sat Sep 16 18:52:43 2017

/u01/JTCDEV/ora_dev/11204/appsutil/clone/bin/../jre/bin/java -Xmx600M -DCONTEXT_VALIDATED=true -Doracle.installer.oui_loc=/u01/JTCDEV/ora_dev/11204/oui -classpath /u01/JTCDEV/ora_dev/11204/appsutil/clone/jlib/xmlparserv2.jar:/u01/JTCDEV/ora_dev/11204/appsutil/clone/jlib/ojdbc6.jar:/u01/JTCDEV/ora_dev/11204/appsutil/clone/jlib/java:/u01/JTCDEV/ora_dev/11204/appsutil/clone/jlib/oui/OraInstaller.jar:/u01/JTCDEV/ora_dev/11204/appsutil/clone/jlib/oui/ewt3.jar:/u01/JTCDEV/ora_dev/11204/appsutil/clone/jlib/oui/share.jar:/u01/JTCDEV/ora_dev/11204/appsutil/clone/jlib/oui/srvm.jar:/u01/JTCDEV/ora_dev/11204/appsutil/clone/jlib/ojmisc.jar   oracle.apps.ad.clone.ApplyDBTechStack -e /u01/JTCDEV/ora_dev/11204/appsutil/DEV2_dev1224.xml -stage /u01/JTCDEV/ora_dev/11204/appsutil/clone   -showProgress
APPS Password : Log file located at /u01/JTCDEV/ora_dev/11204/appsutil/log/DEV2_dev1224/ApplyDBTechStack_09161852.log
  /      0% completed      

Completed Apply...
Sat Sep 16 18:54:59 2017

Starting database listener for DEV2:
Running:
/u01/JTCDEV/ora_dev/11204/appsutil/scripts/DEV2_dev1224/addlnctl.sh start DEV2
Logfile: /u01/JTCDEV/ora_dev/11204/appsutil/log/DEV2_dev1224/addlnctl.txt

You are running addlnctl.sh version 120.4


Starting listener process DEV2 ...


LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 16-SEP-2017 18:54:59

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Starting /u01/JTCDEV/ora_dev/11204/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.4.0 - Production
System parameter file is /u01/JTCDEV/ora_dev/11204/network/admin/DEV2_dev1224/listener.ora
Log messages written to /u01/JTCDEV/ora_dev/11204/admin/DEV2_dev1224/diag/tnslsnr/dev1224/dev2/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dev1224.xxxx.com)(PORT=1587)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dev1224.xxxx.com)(PORT=1587)))
STATUS of the LISTENER
------------------------
Alias                     DEV2
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                16-SEP-2017 18:55:00
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/JTCDEV/ora_dev/11204/network/admin/DEV2_dev1224/listener.ora
Listener Log File         /u01/JTCDEV/ora_dev/11204/admin/DEV2_dev1224/diag/tnslsnr/dev1224/dev2/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dev1224.xxxx.com)(PORT=1587)))
Services Summary...
Service "DEV2" has 1 instance(s).
  Instance "DEV2", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

addlnctl.sh: exiting with status 0

addlnctl.sh: check the logfile /u01/JTCDEV/ora_dev/11204/appsutil/log/DEV2_dev1224/addlnctl.txt for more information ... 


Running ETCC to check status of DB technology patches...

WARNING: ETCC does not exist under /u01/JTCDEV/ora_dev/11204/appsutil/etcc.
Download patch 17537119 from My Oracle Support, unzip it under /u01/JTCDEV/ora_dev/11204/appsutil/etcc and run ETCC to avoid ADOP related issues.




[oradev@dev1224 bin]$
2. Restored the database with RMAN backup.( RMAN backup is full level 0 backup with controlfile, archivelog, dbfs)
Add the below lines to init<SID>.ora file of target system.($O_H/dbs)
*.db_file_name_convert='/u01/JTCPROD/ora_prod/data','/u01/JTCDEV/ora_dev/data'
*.log_file_name_convert='/u01/JTCPROD/ora_prod/data','/u01/JTCDEV/ora_dev/data'

Source the environment file db.env ( ** the environment file copied to the oradev home location /home/oradev from the location $O_H/sid_host.env)

 sql > startup nomount pfile =’ $O_H/dbs/init<SID>.ora’
$ rman auxiliary /
RMAN > duplicate target database to DEV2 backup location ‘/u01/RMANBKP’ nofilenamecheck;
…….
contents of Memory Script:
{
   Alter clone database open resetlogs;
}
executing Memory Script

database opened
Finished Duplicate Db at 16-SEP-17


===============================================================================
3 .Run AutoConfig in the INSTE8_SETUP mode on the database tier as follows:

On UNIX:
$ sh <RDBMS_ORACLE_HOME>/appsutil/bin/adconfig.sh contextfile=<CONTEXT_FILE> run=INSTE8_SETUP

 [oradev@dev1224 ~]$ sh /u01/JTCDEV/ora_dev/11204/appsutil/bin/adconfig.sh contextfile=/u01/JTCDEV/ora_dev/11204/appsutil/DEV2_dev1224.xml run=INSTE8_SETUP
Enter the APPS user password:     Script execution phase specified: INSTE8_SETUP

The log file for this session is located at: /u01/JTCDEV/ora_dev/11204/appsutil/log/DEV2_dev1224/09162025/adconfig.log

AutoConfig is configuring the Database environment...

AutoConfig will consider the custom templates if present.
                Using ORACLE_HOME location : /u01/JTCDEV/ora_dev/11204
                Classpath                   : :/u01/JTCDEV/ora_dev/11204/jdbc/lib/ojdbc6.jar:/u01/JTCDEV/ora_dev/11204/appsutil/java/xmlparserv2.jar:/u01/JTCDEV/ora_dev/11204/appsutil/java:/u01/JTCDEV/ora_dev/11204/jlib/netcfg.jar:/u01/JTCDEV/ora_dev/11204/jlib/ldapjclnt11.jar

                Using Context file          : /u01/JTCDEV/ora_dev/11204/appsutil/DEV2_dev1224.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.

4. Run the library update script against the database.
$ cd <RDBMS ORACLE_HOME>/appsutil/install/<CONTEXT NAME>
$ sqlplus "/ as sysdba" @adupdlib.sql <libext>
Where <libext> should be set to sl for HP-UX, so for any other UNIX platform, or dll for Windows.
[oradev@dev1224 ~]$ . db.env
[oradev@dev1224 ~]$ cd $ORACLE_HOME
[oradev@dev1224 11204]$ cd appsutil
[oradev@dev1224 appsutil]$ cd install/
[oradev@dev1224 install]$ cd DEV2_dev1224/
[oradev@dev1224 DEV2_dev1224]$ sqlplus "/ as sysdba" @adupdlib.sql so

SQL*Plus: Release 11.2.0.4.0 Production on Sun Sep 17 09:07:53 2017
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
PL/SQL procedure successfully completed.
SQL>exit
5 . Configure the Target database.

The database must be running and open before performing this step.
$ cd <RDBMS ORACLE_HOME>/appsutil/clone/bin
$ perl adcfgclone.pl dbconfig <Database Target Context File>
Where "Database Target Context File" is: <RDBMS ORACLE_HOME>/appsutil/<Target CONTEXT_NAME>.xml.

[oradev@dev1224 DEV2_dev1224]$ cd /u01/JTCDEV/ora_dev/11204/appsutil/clone/bin/
[oradev@dev1224 bin]$ ls
adcfgclone.pl  adclonectx.pl  CloneContext_0612123926.log
adchkutl.sh    adclone.pl     CloneContext_0916185106.log
[oradev@dev1224 bin]$ perl adcfgclone.pl dbconfig /u01/JTCDEV/ora_dev/11204/appsutil/DEV2_dev1224.xml

                     Copyright (c) 2002, 2015 Oracle Corporation
                        Redwood Shores, California, USA
                        Oracle E-Business Suite Rapid Clone
                                 Version 12.2
                      adcfgclone Version 120.63.12020000.56
Enter the APPS password :
Running Rapid Clone with command:
Running:
perl /u01/JTCDEV/ora_dev/11204/appsutil/clone/bin/adclone.pl java=/u01/JTCDEV/ora_dev/11204/appsutil/clone/bin/../jre mode=apply stage=/u01/JTCDEV/ora_dev/11204/appsutil/clone component=dbconfig method=CUSTOM dbctxtg=/u01/JTCDEV/ora_dev/11204/appsutil/DEV2_dev1224.xml showProgress contextValidated=false
Beginning dbconfig Apply - Sun Sep 17 09:11:14 2017
/u01/JTCDEV/ora_dev/11204/appsutil/clone/bin/../jre/bin/java -Xmx600M -DCONTEXT_VALIDATED=false -Doracle.installer.oui_loc=/u01/JTCDEV/ora_dev/11204/oui -classpath /u01/JTCDEV/ora_dev/11204/appsutil/clone/jlib/xmlparserv2.jar:/u01/JTCDEV/ora_dev/11204/appsutil/clone/jlib/ojdbc6.jar:/u01/JTCDEV/ora_dev/11204/appsutil/clone/jlib/java:/u01/JTCDEV/ora_dev/11204/appsutil/clone/jlib/oui/OraInstaller.jar:/u01/JTCDEV/ora_dev/11204/appsutil/clone/jlib/oui/ewt3.jar:/u01/JTCDEV/ora_dev/11204/appsutil/clone/jlib/oui/share.jar:/u01/JTCDEV/ora_dev/11204/appsutil/clone/jlib/oui/srvm.jar:/u01/JTCDEV/ora_dev/11204/appsutil/clone/jlib/ojmisc.jar  oracle.apps.ad.clone.ApplyDatabase -e /u01/JTCDEV/ora_dev/11204/appsutil/DEV2_dev1224.xml -stage /u01/JTCDEV/ora_dev/11204/appsutil/clone   -showProgress   -noRmanRecovery yes -checkDBConnection
APPS Password : Log file located at /u01/JTCDEV/ora_dev/11204/appsutil/log/DEV2_dev1224/ApplyDatabase_09170911.log
  |      0% completed      
Log file located at /u01/JTCDEV/ora_dev/11204/appsutil/log/DEV2_dev1224/ApplyDatabase_09170911.log
  -     30% completed      
Completed Apply...
Sun Sep 17 09:12:23 2017
Starting database listener for DEV2:
Running:/u01/JTCDEV/ora_dev/11204/appsutil/scripts/DEV2_dev1224/addlnctl.sh start DEV2
Logfile: /u01/JTCDEV/ora_dev/11204/appsutil/log/DEV2_dev1224/addlnctl.txt
You are running addlnctl.sh version 120.4
Starting listener process DEV2 ...
Listener DEV2 has already been started.
addlnctl.sh: exiting with status 0
addlnctl.sh: check the logfile /u01/JTCDEV/ora_dev/11204/appsutil/log/DEV2_dev1224/addlnctl.txt for more information ... 
Running ETCC to check status of DB technology patches...
WARNING: ETCC does not exist under /u01/JTCDEV/ora_dev/11204/appsutil/etcc.
Download patch 17537119 from My Oracle Support, unzip it under /u01/JTCDEV/ora_dev/11204/appsutil/etcc and run ETCC to avoid ADOP related issues.




CLOINIG APPLICATION TIER

1.Run preclone on application tier

2. for cloning apps tier with dualfs option , you must have txk delta 7 .

SQL> select abbreviation, codelevel from ad_trackable_entities where abbreviation in ('txk','ad'); 

ABBREVIATI CODELEVEL 
---------- ---------- 
ad C.7 
txk C.7 

3. Copy the run file system folder ( /u01/JTCPROD/ora_prod/fs1/EBSapps) ..in my case fs1 is the run file system. You can copy the folder while application services are up , no need of downtime.

 export PATH=/u01/JTCDEV/appl_dev/fs1/EBSapps/10.1.2/perl/bin:$PATH
 export PERL5LIB=/u01/JTCDEV/appl_dev/fs1/EBSapps/10.1.2/perl/lib/5.6.1
 export PATH=/u01/JTCDEV/appl_dev/fs1/EBSapps/10.1.2/bin:$PATH
 cd /u01/JTCDEV/appl_dev/fs1/EBSapps/comn/clone/bin

 perl adcfgclone.pl appsTier dualfs



 
 
Postcloning steps :

1. Update profile options ,Update to avoid JSP error in xml reports

$ sqlplus apps/xxxx

SQL> select PROPERTY_CODE,value from apps.XDO_CONFIG_VALUES where
PROPERTY_CODE like '%SYSTEM_TEMP_DIR%';

SQL> update XDO_CONFIG_VALUES set VALUE='custom_top/12.0.0/out' where PROPERTY_CODE like 'SYSTEM_TEMP_DIR';

SQL > commit;


2. Update other profile options like sitename, color, workflow etc.

Done with cloning. Happy learning