Logo Background

Oracle Applications Cloning Process

  • By on June 19, 2009 | 2 Comments

    This is the step by step cloning process which I have wrote in performing cloning on Oracle Applications 11i.

    We need the involvement of APPS DBA & DBA in performing the cloning process with the segregation of duties according to SOX.

    In this documentation, I assume you have prepare your backup before running the cloning activity.

    Remember, this step by step was just applicable to Oracle E-Business Suite Applications 11i cloning and the environment setting might differs than the one you are running on.

    Step 1 – Backup Configuration Files In Target System

    Create a backup directory in target system (APPS & DB Tier) to backup existing configuration files.

    Backup Configuration Files On the DB Tier (by DBA)

    $ mkdir /oracle/apps/preclone_backup_<DDMMYY>

    1. Backup the XML files

    $ cp $CONTEXT_FILE /oracle/apps/preclone_backup_<DDMMYY>

    2. Backup the tnsnames.ora and listener.ora files

    $ cp $ORACLE_HOME/network/admin/tnsnames.ora 
    /oracle/apps/preclone_backup_<DDMMYY>/tnsnames.ora
     
    $ cp $ORACLE_HOME/network/admin/listener.ora 
    /oracle/apps/preclone_backup_<DDMMYY>/listener.ora
     
    $ cp $ORACLE_HOME/network/admin/$CONTEXT_NAME/tnsnames.ora 
    /oracle/apps/preclone_backup_<DDMMYY>/tnsnames_/$CONTEXT_NAME.ora
     
    $ cp $ORACLE_HOME/network/admin//$CONTEXT_NAME/listener.ora 
    /oracle/apps/preclone_backup_<DDMMYY>/listener_$CONTEXT_NAME.ora

    Backup Configuration Files On the Apps Tier (by APPS DBA)

    $ mkdir /oracle/apps/preclone_backup_<DDMMYY>

    1. Backup the Apache SSL configuration files:

    $ cp -R $COMMON_TOP/admin/certs/apache /oracle/apps/preclone_backup_<DDMMYY>

    2. Backup the XML files

    $ cp $CONTEXT_FILE /oracle/apps/preclone_backup_<DDMMYY>
    $ cp $APPL_TOP/admin/*xml /oracle/apps/preclone_backup_<DDMMYY>

    Note: Make sure other configuration node XML files was backup as well

    3. Backup the tnsnames.ora, listener.ora and ifile.ora files

    $ cp $ORACLE_HOME/network/admin/tnsnames.ora 
    /oracle/apps/preclone_backup_<DDMMYY>/tnsnames.ora
     
    $ cp $ORACLE_HOME/network/admin/$CONTEXT_NAME/tnsnames.ora 
    /oracle/apps/preclone_backup_<DDMMYY>/tnsnames_$CONTEXT_NAME.ora
     
    $ cp $ORACLE_HOME/network/admin//$CONTEXT_NAME/listener.ora 
    /oracle/apps/preclone_backup_<DDMMYY>/listener_$CONTEXT_NAME.ora
     
    $ cp $ORACLE_HOME/network/admin//$CONTEXT_NAME/*ifile.ora 
    /oracle/apps/preclone_backup_<DDMMYY>/ifile_$CONTEXT_NAME.ora

    4. Backup the $APPL_TOP/admin/adovars.env file

    $ cp $APPL_TOP/admin/adovars.env /oracle/apps/preclone_backup_<DDMMYY>/adovars.env

    Step 2 – Prepare The Source System

    Execute the following commands to prepare the source system for cloning.

    Prepare the source system database tier for cloning (by DBA)

    Log on to the source system as the ORACLE user and run the following commands:

    On the DB Tier:

    $ cd $ORACLE_HOME/appsutil/scripts/$CONTEXT_NAME
    $ perl adpreclone.pl dbTier

    Note: Not applicable unless we need to refresh existing DB environment with the new configuration setting

    Prepare the source system application tier for cloning (by APPS DBA)

    Log on to the source system as the APPLPROD user and run the following commands on node that contains an $APPL_TOP.

    On the Apps Tier:

    $ cd $COMMON_TOP/admin/scripts/$CONTEXT_NAME
    $ perl adpreclone.pl appsTier
     
    Running Rapid Clone with command...
            perl /oracle/apps/prodappl/ad/11.5.0/bin/adclone.pl java=/opt/java1.4 
    mode=stage stage=/oracle/apps/prodcomn/clone 
    component=appsTier method=CUSTOM 
    appctx=/ oracle/apps/prodappl/admin/ORAEB1P_gvu3530.xml  showProgress
     
    Beginning application tier Stage - Thu Feb 12 03:31:05 2009
    Log file located at /oracle/apps/prodappl/admin/ORACLE_APPS
    /log/StageAppsTier_02120331.log
     
    Completed Stage...
    Thu Feb 12 03:38:11 2009
     
    Completed running perl /oracle/apps/prodappl/ad/11.5.0/bin/adclone.pl 
    java=/opt/java1.4 mode=stage stage=/oracle/apps/prodcomn/clone 
    component=appsTier method=CUSTOM appctx=/oracle/apps/prodappl
    /admin/ORACLE_APPS.xml  showProgress ...

    Note: Not applicable unless we need to refresh existing APPS environment with the new configuration setting

    Step 3 – Copy The Source System To The Target System

    Copy the application tier file system from the source Applications system to the target node by executing the following steps in the order listed. Ensure the application tier files copied to the target system are owned by the target APPLPROD user, and that the database tier files are owned by the ORACLE user.

    Copy the application tier file system (by APPS DBA)

    Log on to the source system application tier nodes as the APPLPROD user.
    • Shut down the application tier server processes
    • Copy the following application tier directories from the source node to the target application tier node:
    – $APPL_TOP
    – $OA_HTML
    – $OA_JAVA
    – $OA_JRE_TOP
    – $COMMON_TOP/util
    – $COMMON_TOP/clone
    – $COMMON_TOP/_pages (when this directory exists)
    – 806 ORACLE_HOME
    – iAS ORACLE_HOME

    Note: Unix/Linux users, make sure that the soft links are preserved when copying.

    We will just backup the whole $COMMON_TOP, $APPL_TOP and $ORACLE_HOME in APPS Tier with the directory specified above should be included as well.

    $ mkdir /support/PROD_backup/ 
     
    $ cd /oracle/apps
    $ tar -cvf /support/PROD_backup/PROD_backup_<DDMMYY>.tar prodcomn prodappl prodora

    Copy the database tier file system (by DBA)

    Log on to the source system database node as the ORACLE user.
    • Perform a normal shutdown of the source system database
    • Copy the database (DBF) files from the source to the target system
    • Copy the source database ORACLE_HOME to the target system
    • Start up the source Applications system database and application tier processes

    Note: Target system DB should started manually and not via adcfgclone from the hot backup

    Transfer the TAR files from source system to target system after you have all the files.

    Step 4 – Prepare The Target System

    1. Please change the value of /var/opt/oracle/oraInst.loc so that inventory_loc will point to: /oracle/apps/oraInventory via the script execution in oraInst.sh

    #=========================
    # oraInst.sh shell script
    #=========================
    #!/usr/bin/ksh
     
    filename=/var/opt/oracle/oraInst.loc
     
    echo "inventory_loc=/oracle/apps/oraInventory" >$filename
    echo "inst_group=dba" >>$filename
     
    print - "output saved in $filename"

    Note: This step was necessary to prevent error when running perl adcfgclone.pl appsTier in APPS Tier. The oracle directory should have permission: 770 and owner: root:dba. The oraInst.loc file should have the permission:750 and owner: root:dba

    2. Extract the cloning application files to Target System’s APPS Tier environment

    $ cd /oracle/apps
    $ tar –xvf /support/BCK/PROD_backup_<DDMMYY>.tar

    4. Rename the directories in Target System’s APPS Tier environment

    $ cd /oracle/apps
    $ mv prodcomn testcomn
    $ mv prodora testora
    $ mv prodappl testappl

    3. Change the owner and group of the files/directories.

    $ chown -R appltest:dba testcomn testora testappl

    4. Restore the previous APPS XML configuration files back to original location

    $ cd /oracle/apps/preclone_backup_<DDMMYY>
    $ cp *.xml /oracle/apps/testappl/admin

    5. Restore the Target System’s APPS tnsnames.ora back to original location

    $ cd /oracle/apps/preclone_backup_<DDMMYY>
    $ cp tnsnames.ora /oracle/apps/testora/8.0.6/network/admin

    6. Define the environment variables for Target System’s APPS Tier environment

    export ORACLE_HOME=/oracle/apps/testora/8.0.6
    export ORACLE_SID=ORACLE_DB
    export TWO_TASK=ORACLE_DB
    export LOCAL=
    export umask=022
    export PERL5LIB=/oracle/apps/testora/iAS/Apache/perl/lib/5.00503:
    /oracle/apps/testora/iAS/Apache/perl/lib/site_perl/5.005:
    /oracle/apps/testappl/au/11.5.0/perl:/oracle/apps/testora/iAS/Apache/perl/bin
    export PATH=/oracle/apps/testora/iAS/Apache/perl/bin/perl:
    $ORACLE_HOME/bin:/usr/X11R6/bin:$ORACLE_HOME/perl/bin:/opt/java1.4/bin:
    /opt/Acc/lib:/usr/ucb:/usr/ccs/bin:$PATH
    export JAVA_TOP=/oracle/apps/testcomn/java
    export AF_JRE_TOP=/opt/java1.4
    export CLASSPATH=/opt/java1.4/lib/dt.jar:/opt/java1.4/lib/tools.jar:
    /opt/java1.4/jre/lib/rt.jar:/opt/java1.4/jre/lib/charsets.jar:
    /oracle/apps/testcomn/java/appsborg2.zip:/oracle/apps/testcomn/java/apps.zip:
    /oracle/apps/testora/8.0.6/forms60/java:/oracle/apps/testcomn/java 
    export COMMON_TOP=/oracle/apps/testcomn
    export APPL_TOP=/oracle/apps/testappl
    export CONTEXT_NAME=<input your original CONTEXT_NAME of 
    Target System's APPS Tier environment>

    7. Test connects to the DB via SQL*PLUS DB (if not the adcfgclone.pl on the APPS Tier will fail):

    $ cd $ORACLE_HOME/bin
    $ sqlplus apps/apps@ORACLE_DB

    Verify your connection instance, make sure you are connected to the correct database

    SQL> SELECT name FROM v$database;
    SQL> SELECT instance_name, host_name FROM v$instance;

    Step 5 – Configure The Target System

    1. Avoid the execution of Alerts and schedule concurrent on the test environments. Enter as apps user to SQL* PLUS and execute all the command as below:

    SQL> UPDATE fnd_profile_option_values SET profile_option_value=
    'CLONE ('||to_char(sysdate-1,'dd-Mon-yy')||')' WHERE profile_option_id=125;
     
    SQL> UPDATE FND_CONCURRENT_QUEUES SET NODE_NAME=NULL, NODE_NAME2=NULL 
    WHERE NODE_NAME2 IS NOT NULL;
     
    SQL> TRUNCATE TABLE applsys.FND_CONCURRENT_REQUESTS;
     
    SQL> TRUNCATE TABLE applsys.FND_RUN_REQUESTS;
     
    SQL> TRUNCATE TABLE applsys.FND_CONC_REQUEST_ARGUMENTS;
     
    SQL> TRUNCATE TABLE applsys.FND_CONCURRENT_PROCESSES;
     
    SQL> TRUNCATE TABLE applsys.FND_CONC_STAT_LIST;
     
    SQL> TRUNCATE TABLE applsys.FND_CONC_STAT_SUMMARY;
     
    SQL> TRUNCATE TABLE applsys.FND_RUN_REQ_PP_ACTIONS;
     
    SQL> TRUNCATE TABLE applsys.WF_NOTIFICATIONS;
     
    SQL> UPDATE fnd_profile_option_values f
    SET f.profile_option_value = 'BLUE'
    WHERE f.profile_option_id = 5785;
     
    SQL> UPDATE  ALR_ALERTS 
    SET  enabled_flag = 'N'
    WHERE application_id = 20003
    AND  enabled_flag = 'Y';
     
    SQL> cmclean.SQL (download the cmclean.SQL FROM Oracle Metalink)
     
    SQL> EXEC FND_CONC_CLONE.SETUP_CLEAN; 
    COMMIT; 
    EXIT;

    Execute a commit statement in the end of all these statement. Be very sure that you executed this command in your clone instance.

    2. Configure the target system database server
    Log on to the target system as the ORACLE user and type the following commands to configure and start the database:

    $ cd $ORACLE_HOME/appsutil/clone/bin 
    $ perl adcfgclone.pl dbTier $ORACLE_HOME/appsutil/$CONTEXT_NAME.xml

    Note: Not applicable unless we need to refresh existing DB environment with the new configuration setting

    For RAC environment, DBA must run the autoconfig in the database instance to prevent error in adcfgclone.pl execution in APPS Tier environment

    3. Configure the target system application tier server nodes
    Log on to the target system as the APPLPROD user and type the following commands:

    $ cd $COMMON_TOP/clone/bin
    $ perl adcfgclone.pl appsTier (for new environment)
    or 
    $ perl adcfgclone.pl appsTier \
    "$APPL_TOP/admin/$CONTEXT_NAME.xml" (for existing environment)

    Note: Run the adcfgclone.pl in Apps Tier, Discoverer Server primary and secondary. Re-run again adcfgclone.pl in Apps Tier if it doesn’t work. Always make sure the value in the file /var/opt/oracle/oraInst.loc before running adcfgclone.pl

    Note: If the process failed with an error: “Can’t connect to the DB”, then copy the original tnsnames.ora to /oracle/apps/testora/8.0.6/network/admin/$CONTEXT_NAME

    4. Once adcfgclone.pl completed, exit the session and re-login again to source the new environment file which was defined in $HOME/.profile

    5. Fix the path in $APPL_TOP/admin/adovars.env, ixlibs.cfg, pasta.cfg and heb_pasta.cfg so that the PS (PostScript) reports won’t fail (optional if your apps not using PS reports). In VI mode, execute the command as below: –

    (i) :%s;/oracle/apps/prodappl;/oracle/apps/testappl;g  
    (ii) :%s;/oracle/apps/prodora;/oracle/apps/testora;g 
    (iii) :%s;/oracle/apps/prodcomn;/oracle/apps/testcomn;g

    6. Change SYSADMIN and APPS password on clone environment

    # Change SYSADMIN password
    $ FNDCPASS apps/<password> 0 Y system/<password> USER SYSADMIN <password>
    # Change APPS password
    $ FNDCPASS apps/<password> 0 Y system/<password> SYSTEM APPLSYS <password>

    7. Copy back the saved Apache SSL certification directories and files.

    $ cp -R /oracle/apps/preclone_backup_<DDMMYY>/apache/* \
    /oracle/apps/testcomn/admin/certs/apache

    Notes: Make sure the following XML variable is set correctly: S_WEB_SSL_DIRECTORY in $CONTEXT_FILE

    8. Run adadmin in Target System’s APPS Tier and perform the following activity:
    – Compile APPS schema
    – Re-create grants and synonyms for APPS schema
    – Relink Applications programs
    – Compile Flexfields
    – Generate JAR Files

    9. Run autoconfig in Target System’s APPS Tier.

    $ cd $COMMON_TOP/admin/scripts/$CONTEXT_NAME
    $ ./adautocfg.sh

    10. Start Application and Concurrent on Application Tier using the command below: –

    $ $COMMON_TOP/admin/scripts/$CONTEXT_NAME/adstrtal.sh apps/<password>

    11. If there’s error in starting up Concurrent Manager – Concurrent Manager cannot find error description for CONC-System Node Name not Registered, perform the following: –
    – Go to System Administrator responsibility > Install > Nodes
    – Create the entry of the physical server name for application server (if the entry does not exist)
    – Create the FNDSM_’servername’ for all of the nodes that exists in the FND_NODES table by running the script below: –

    $ cd $FND_TOP/patch/115/sql
    $ sqlplus apps/<password> @afdcm037.sql

    12. Login to OAM – Workflow Notification Mailer to change the username/password setting for clone environment.

    Notes: Do not startup the Workflow Notification Mailer.

    13. Set the testing email address on Workflow Notification Mailer by login into UNIX.

    $ cd $FND_TOP/sql
    $ sqlplus apps/<password> @afsvcpup.sql
     
    Enter Component Id: =  10006        "Workflow Notification Mailer"
    Enter the Comp Param Id to update : =  10093     "Test Address"
     
    Set the testing e-mail with the desired email address.

    14. Run adpreclone.pl on the appsTier and dbTier (optional to make sure the clone environment was 100% working)

    Previous
    Next
    » Rebounce Or Restart Apache In Oracle Applications
  1. #1 Samer
    June 30, 2009 10:52 pm

    Hi ,

    are you sure about the permission on “The oracle directory should have permission: 770 and owner: root:dba. The oraInst.loc file should have the permission:750 and owner: root:dba”

    coz currently in our environment its oracle:dba ( 755 )
    and oraInst.loc is owned by root:system ( 644 )

    kindly advise

    Post ReplyPost Reply
  1. #2 Jing Hong
    June 30, 2009 11:10 pm

    Hi Samer,

    I believe you are having the “oracle” access and you having no problem in accessing the oracle directory.

    But it seems that your oraInst.loc was only read & write for “root” user only. If you are going to install a new Oracle environment in your current node where there’s existing ORACLE_HOME live, then you need to edit the oraInst.loc file (either using root or make it chmod 750 and make sure you are same group with root) before proceed to installation.

    For this case, I change the value in oraInst.loc as I have 2 environment of Oracle Apps 11i sitting in the same machine. Hope this clarify :)

    Post ReplyPost Reply
Leave a Comment