Oracle EBS Database RAC to RAC database cloning

Oracle EBS Suite Database RAC to RAC database cloning

First Copy the ORACLE_HOME from production RAC servers to test RAC servers

Step 1: Set the path in target server(it depend on os level and specific to customers)

PATH="/erp_base/app/oracle/product/12.1.0.2/bin:/erp_base/app/12.1.0/grid/bin:/usr/local/bin:/usr/bin:/usr/ucb:/usr/sbin:/etc:.:."
export PATH


PATH=/erp_base/app/oracle/product/12.1.0.2/bin:/erp_base/app/12.1.0/grid/bin:$PATH
export PATH

Step 2: create pairsfile.txt under appsutil/clone folder with the following contents in primary first RAC node


s_undo_tablespace=APPS_UNDOTS1
s_dbClusterInst=2
s_db_oh=/erp_base/app/oracle/product/12.1.0.2

Step 3: Create Context File for Primary RAC Node

Navigate to /erp_base1/app/oracle/product/12.1.0.2/appsutil/clone/bin and run the adclonectx.pl utility with the following parameters

perl adclonectx.pl \
contextfile=/erp_base/app/oracle/product/12.1.0.2/appsutil/ERPROD1_erpprod01.xml \
template=/erp_base/app/oracle/product/12.1.0.2/appsutil/template/adxdbctx.tmp \
pairsfile=/erp_base/app/oracle/product/12.1.0.2/appsutil/clone/pairsfile.txt \
initialnode




                     Copyright (c) 2011, 2015 Oracle Corporation
                        Redwood Shores, California, USA

                        Oracle E-Business Suite Rapid Clone

                                 Version 12.2

                      adclonectx Version 120.30.12020000.21

Running:
/erp_base/app/oracle/product/12.1.0.2/appsutil/clone/bin/../jre/bin/java -Xmx600M -classpath /erp_base/app/oracle/product/12.1.0.2/appsutil/clone/bin/../jlib/ojdbc6.jar:/erp_base/app/oracle/product/12.1.0.2/appsutil/clone/bin/../jlib/xmlparserv2.jar:/erp_base/app/oracle/product/12.1.0.2/appsutil/clone/bin/../jlib/java: oracle.apps.ad.context.CloneContext  -e /erp_base/app/oracle/product/12.1.0.2/appsutil/ERPROD1_erpprod01.xml -tmpl /erp_base/app/oracle/product/12.1.0.2/appsutil/template/adxdbctx.tmp -pairsfile /erp_base/app/oracle/product/12.1.0.2/appsutil/clone/pairsfile.txt -initialnode
Enter the APPS password :

Log file located at /erp_base/app/oracle/product/12.1.0.2/appsutil/clone/bin/CloneContext_0729092614.log

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

Target System Hostname (virtual or normal) [erpdev01] :

Target System Domain Name : nizam.corp.com

It is recommended that your inputs are validated by the program.
However you might choose not to validate them under following circumstances:

        -If cloning a context on source system for a remote system.
        -If cloning a context on a machine where the ports are taken and
         you do not want to shutdown the services at this point.
        -If cloning a context but the database it needs to connect is not available.

Do you want the inputs to be validated (y/n) [n] ? :

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

Target System Database Name : ERPDBA

Do you want to enable SCAN addresses (y/n) [y] ? :

Specify value for Scan Name : ERPDEV-scan

Specify value for Scan Port : 1521

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] : 8
Report file located at /erp_base/app/oracle/product/12.1.0.2/appsutil/out/portpool.lst

Provide information for the initial RAC node:

    Host name [erpprod01] : erpdev01

    Virtual Host name [null] : erpdev01-vip

    Instance number [1] :

    Private interconnect name [erpprod01] : erpdev01-priv1.nizam.corp.com

Target System Base Directory : /erp_base/app/oracle/product/

Oracle OS User [oradev] :

Oracle OS Group [oinstall] :

Target System utl_file_dir Directory List : /usr/tmp

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

Target System DATA_TOP Directory 1 : +DATA/ERPDBA/datafile

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

Target System Display [erpdev01:0.0] :

New context path and file name [/erp_base/app/oracle/product/12.1.0.2/appsutil/ERPDBA1_erpdev01.xml] :
The new database context file has been created :
  /erp_base/app/oracle/product/12.1.0.2/appsutil/ERPDBA1_erpdev01.xml
contextfile=/erp_base/app/oracle/product/12.1.0.2/appsutil/ERPDBA1_erpdev01.xml
Check Clone Context logfile /erp_base/app/oracle/product/12.1.0.2/appsutil/clone/bin/CloneContext_0729092614.log for details.


Step 4: edit context file in primary RAC node as below


Edit the newly generated contextfile.xml (of the form <newsid_hostname>.xml) to review or change the following remote and local listener, database name, and  names as shown:
•s_instLocalListener value should be LISTENER_<NEW_SID>
•s_instRemoteListener value should be LISTENERS_<GLOBAL_DBNAME>
•s_dbGlnam value should be <GLOBAL DBNAME> and not a sid name

Step 5: Configure Oracle Home 


perl adclone.pl \
java=/erp_base/app/oracle/product/12.1.0.2/appsutil/clone/jre \
component=dbTechStack \
mode=apply \
stage=/erp_base/app/oracle/product/12.1.0.2/appsutil/clone \
method=CUSTOM \
dbctxtg=/erp_base/app/oracle/product/12.1.0.2/appsutil/ERPDBA1_au1643.xml \
showProgress contextValidated=true \


Step 6: Restore the database. Please use below link for database restore

https://nizamappsdba.blogspot.com/2019/07/rman-database-restore-command-running.html

Or Duplicate the database using below link

https://nizamappsdba.blogspot.com/2019/09/duplicate-database-from-rman-backup.html

OR

-- Configure Oracle Home and  restore database together(Step 5 and step 6 together)-- THIS METHOD IS NOT TESTED SO FAR
------------------------------------------------------------------------------------------

perl adclone.pl \
java=/erp_base/app/oracle/product/12.1.0.2/appsutil/clone/jre \
component=dbTier \
mode=apply \
stage=/erp_base/app/oracle/product/12.1.0.2/appsutil/clone \
method=RMAN \
dbctxtg=/erp_base/app/oracle/product/12.1.0.2/appsutil/ERPDBA1_erpdev01.xml \
rmanstage=/export/home/hrd_bkp/oradata/HRD/rman/bkp_sets \
rmantgtloc=+ASM/ERPDBA \
srcdbname=ERPDBA \
showProgress


Step 7: start listener On Primary RAC Node

lsnrctl start ERPDBA


Step 8: Create the pairsfile.txt in second RAC node


create pairsfile.txt under /erp_base1/app/oracle/product/12.1.0.2/appsutil/clone folder with the following contents


s_undo_tablespace=APPS_UNDOTS20
s_dbClusterInst=2
s_db_oh=/erp_base/app/oracle/product/12.1.0.2


Step 9: Create Context File for secondary RAC Node

Copy the primary RAC database node CONTEXT_FILE(ERPDBA1_erpdev01.xml) which was created as per the step 3 to Secondary RAC database Node on /erp_base/app/oracle/product/12.1.0.2/appsutil directory

then Navigate to /erp_base/app/oracle/product/12.1.0.2/appsutil/clone/bin and run the adclonectx.pl utility with the following parameters on secondary database RAC node

perl adclonectx.pl \
contextfile=/erp_base/app/oracle/product/12.1.0.2/appsutil/ERPDBA1_erpdev01.xml \
template=/erp_base/app/oracle/product/12.1.0.2/appsutil/template/adxdbctx.tmp \
pairsfile=/erp_base/app/oracle/product/12.1.0.2/appsutil/clone/pairsfile.txt \
addnode


-bash-4.4$ perl adclonectx.pl \
> contextfile=/erp_base/app/oracle/product/12.1.0.2/appsutil/ERPDBA1_au1643.xml \
> template=/erp_base/app/oracle/product/12.1.0.2/appsutil/template/adxdbctx.tmp \
> pairsfile=/erp_base/app/oracle/product/12.1.0.2/appsutil/clone/pairsfile.txt \
> addnode

                     Copyright (c) 2011, 2015 Oracle Corporation
                        Redwood Shores, California, USA

                        Oracle E-Business Suite Rapid Clone

                                 Version 12.2

                      adclonectx Version 120.30.12020000.21

Running:
/erp_base/app/oracle/product/12.1.0.2/appsutil/clone/bin/../jre/bin/java -Xmx600M -classpath /erp_base/app/oracle/product/12.1.0.2/appsutil/clone/bin/../jlib/ojdbc6.jar:/erp_base/app/oracle/product/12.1.0.2/appsutil/clone/bin/../jlib/xmlparserv2.jar:/erp_base/app/oracle/product/12.1.0.2/appsutil/clone/bin/../jlib/java: oracle.apps.ad.context.CloneContext  -e /erp_base/app/oracle/product/12.1.0.2/appsutil/ERPDBA1_au1643.xml -tmpl /erp_base/app/oracle/product/12.1.0.2/appsutil/template/adxdbctx.tmp -pairsfile /erp_base/app/oracle/product/12.1.0.2/appsutil/clone/pairsfile.txt -addnode
Enter the APPS password :

Log file located at /erp_base/app/oracle/product/12.1.0.2/appsutil/clone/bin/CloneContext_0113161336.log

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

Target System Hostname (virtual or normal) [au1644] :

Target System Domain Name : etisalat.corp.ae

It is recommended that your inputs are validated by the program.
However you might choose not to validate them under following circumstances:

        -If cloning a context on source system for a remote system.
        -If cloning a context on a machine where the ports are taken and
         you do not want to shutdown the services at this point.
        -If cloning a context but the database it needs to connect is not available.

Do you want the inputs to be validated (y/n) [n] ? :

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

Please provide the details to connect to one of live RAC nodes


Host name of the live RAC node : erpdev01

Domain name of the live RAC node : etisalat.corp.ae

Database SID of the live RAC node : ERPDBA1

Listener port number of the live RAC node : 1529

Provide information for the new Node:

    Host name : erpdev02

   Virtual Host name : erpdev02-vip

    Instance number : 2

    Private interconnect name : erpdev02-priv1.etisalat.corp.ae
Current Node:
    Host Name       : erpdev02

    SID             : ERPDBA2

    Instance Name   : ERPDBA2

    Instance Number : 2

    Instance Thread : 2

    Undo Table Space:

    Listener Port   : 1529

Target System Base Directory : /erp_base/app/oracle/

Oracle OS User [oradev] :

Oracle OS Group [oinstall] :

Target System utl_file_dir Directory List : /usr/tmp

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

Target System DATA_TOP Directory 1 : +DATA

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

Target System Display [erpdev02:0.0] :

New context path and file name [/erp_base/app/oracle/product/12.1.0.2/appsutil/ERPDBA2_erpdev02.xml] :
The new database context file has been created :
  /erp_base/app/oracle/product/12.1.0.2/appsutil/ERPDBA2_erpdev02.xml
contextfile=/erp_base/app/oracle/product/12.1.0.2/appsutil/ERPDBA2_erpdev02.xml
Check Clone Context logfile /erp_base/app/oracle/product/12.1.0.2/appsutil/clone/bin/CloneContext_0113161336.log for details.
-bash-4.4$


Navigate to /erp_base/app/oracle/product/12.1.0.2/appsutil/clone/bin

 $ perl adcfgclone.pl dbTechStack /erp_base/app/oracle/product/12.1.0.2/appsutil/ERPDBA2_erpdev02.xml

Step 10: start listener On Secondary RAC Node


lsnrctl start ERPDBA

Step 11: Edit Modify [SID]_APPS_BASE.ora(ERPDBA1_APPS_BASE.ora and ERPDBA2_APPS_BASE.ora)


Edit the [SID]_APPS_BASE.ora file and change the control file parameter to reflect the correct control file location on the shared storage.


Step 12 :Run Autocofig on Primary, Secondary and again primary node(It required to create the Load Balancing TNS entries)


./adautocfg.sh (PriMary RAC Node)
./adautocfg.sh (Secondary RAC Node)
./adautocfg.sh (Again Primary RAC Node)

Step 13: Create a spfile from the pfile on all nodes as follows( Optional, if you wish to keep the spfile on shared ASM disk)

Create an spfile from the pfile, and then create a pfile in a temporary location from the new spfile, with commands as shown in the following example:

SQL>create spfile=/erp_base/app/oracle/product/12.1.0.2/dbs/spfileERPDBA.ora from pfile;
SQL>create pfile='/tmp/pfiletERPDBA.ora' from spfile='/erp_base/app/oracle/product/12.1.0.2/dbs/spfileERPDBA.ora';

Repeat this step on all nodes.

Combine the initialization parameter files for all instances into one initdbname.ora file by copying all existing shared contents. All shared parameters defined in your initdbname.ora file must be global, with the format *.parameter=value

Modify all instance-specific parameter definitions in init<SID>.ora files using the following syntax, where the variable <SID> is the system identifier of the instance: <SID>.parameter=value

Note: Ensure that the below parameters 

LOCAL_LISTENER,diagnostic_dest,undo_tablespace,thread,instance_number,instance_name are in .parameter format; for example, .LOCAL_LISTENER=. These parameters must have one entry for an instance.

Create the spfile in the shared ASM location from the pfile init.ora above.

SQL>create spfile='+DATA/ERPDBA/parameterfile/spfileERPDBA.ora' from pfile='/erp_base/app/oracle/product/12.1.0.2/dbs/pfileERPDBA.ora';

Step 14: Register Oracle Databases in the Cluster Services


srvctl add database -d ERPDBA -o $ORACLE_HOME -p '+DATA/ERPDBA/parameterfile/spfileERPDBA.ora' -a 'DATA,RECO,OCRDG'
srvctl add instance -d ERPDBA -i ERPDBA1 -n erpdev01
srvctl add instance -d ERPDBA -i ERPDBA2 -n erpdev02

srvctl setenv database -d ERPDBA  -t ORA_NLS10='/erp_base/app/oracle/product/12.1.0.2/nls/data/9idata'

srvctl setenv database -d ERPDBA -T TNS_ADMIN=$ORACLE_HOME/network/admin

Step 15: Update OCR with new SPFILE location


srvctl modify database -d ERPDBA -p +DATA/ERPDBA/parameterfile/spfileERPDBA.ora


Reference: 
Manually Cloning Oracle Applications Release 11i with 10g or 11g RAC [ID 760637.1]
Cloning Oracle E-Business Suite Release 12.2 RAC Enabled Systems with Rapid Clone (Doc ID 1679270.1)



appsdbahelp

17+ years of experience in Oracle Database, Oracle Cloud Infrastructure(OCI), Oracle EBS on Cloud, Oracle E-Business Suite, DevOps tools, Oracle WebLogic, Oracle Application Server, Oracle Access Manager and various Operating System flavors including Redhat Linux, UNIX (Solaris, HP-UX) and Windows. Expert in Oracle9i/10g/11g/12c/19c database administration, upgrade, configuration and tuning. Experience in Oracle E-Business Suite technological stack, including architecture, installation, configuration, maintenance, tuning, cloning and patching procedures. Expert in Oracle Cloud Infrastructure(OCI), Oracle EBS On Cloud and Oracle EBS Cloud Manager Experience with Oracle Cloud Solution and Expert of Oracle ERP/Oracle HCM Cloud deployment Experience in Terraform, JSON and chef cloud infrastructure automation framework Knowledge of ASM, Data Guard, Real Application Cluster, Exadata and Exalogic Knowledge of Oracle Enterprise Manager(OEM) Grid Control, Oracle WebLogic, Oracle Internet Directory, Oracle Access Manager and Apache Ability to analyze problem, develops solutions and bring program/project execution to completion.

Post a Comment

Previous Post Next Post