12 Replies Latest reply on Jul 17, 2018 10:17 AM by Shareef Khaleel

    How to pass arguments to adcfgclone to automate cloning process

    Shareef Khaleel

      Dear All,

       

      We are using Oracle EBS 12.1.2; DB: 11.1.0.7; OS: Oracle Linux 7.3;

       

      How can we pass arguments (as a file) to adcfgclone to automate the process for both dbTier and appsTier?

       

       

      Thanks and Regards,

      Shareef

        • 1. Re: How to pass arguments to adcfgclone to automate cloning process
          Maynard with Xenemm

          Preserve a copy of your existing context file of your target system. (If you don't have a context file, you will need to run the clone interactively and generate one)

           

          Put the preserved context file in the correct location for your tier.

           

          pass the context file as a parameter of the adcfgclone command

          • 2. Re: How to pass arguments to adcfgclone to automate cloning process
            Shareef Khaleel

            Dear Maynard,

             

            Thanks; I can understand that:

            To achieve cloning automation; We do the following steps:  (Assuming that each new clone will be identical to this one; host;SID; Base Directory; ports; Display...etc);

             

            1. For the first clone; we will answer questions interactively;

               Database Tier:

               $perl adcfgclone.pl dbTier

                {

                 PASSWORD:

                 Target System Hostname (virtual or normal) [clone server name] :

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

                 Target System Database SID :

                 Target System Base Directory :

                 Target System utl_file_dir Directory List :

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

                 Target System Data_Top directory 1 [/d01/oracle/PROD/db/apps_st/data] :

                 Target system RDBMS ORACLE_HOME Directory [ /d01/oracle/db/tech_st/11.1.0] :

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

                 Target System Display [clonedb:0.0] :

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

                 Target System Port Pool [0-99] :

                }

             

            Application Tier:

            $perl adcfgclone.pl appsTier

               {

                      Target System Hostname (virtual or normal) [clone server name] :

                      Target System Database SID :

                      Target System Database Server Node [clone server name] :

                      Target System Database Domain Name [clone server domain name] :

                      Target System Base Directory :

                      Target System Tools ORACLE_HOME Directory [clone tools home ] :

                      Target System Web ORACLE_HOME Directory [clone Web home ] :

                      Target System APPL_TOP Directory [clone application top directory ] :

                      Target System COMMON_TOP  Directory [clone common top directory ] :

                      Target System Instance Home Directory [clone instance home directory ] :

                      Target System Root Service [enabled] :

                      Target System Web Entry Point  Services [enabled] :

                      Target System Web Application Services [enabled] :

                      Target System Batch Processing Services [enabled] :

                      Target System Other Services [disabled] :

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

                      Target System Display [appsclone:0.0]- Clone server display settings:

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

                      Target System Port Pool [0-99]:

                      Choose a value which will be set as APPLTMP value on the target node [1]:

              }

             

            1.2. Copy generated dbTier context file ($ORACLE_HOME/appsutil/<SID>_<HOSTNAME>.xml)

              and AppsTier generated context file ($INST_TOP/appl/admin/<SID>_<HOSTNAME>.xml)

            to reuse these files in the next clone

             

            2. Second clone and later; i will copy files from step 1.2 into dbTier  $ORACLE_HOME/appsutil/

                and appsTier $INST_TOP/appl/admin/;

            2.1. then:

                $perl adcfgclone.pl dbTier clone_dbclone.xml

                      for database

                 and

                $perl adcfgclone.pl appsTier clone_appsclone.xml

                     for application

             

              Is that correct?

             

            Thanks and Regards,

            Shareef

            • 3. Re: How to pass arguments to adcfgclone to automate cloning process
              Maynard with Xenemm

              That is correct.

               

              1 thing to note:

              When you source the environment for the EBS tier, you should have an environment variable $CONTEXT_FILE defined. Just make sure that when you restore the context file you've preserved that the full path and file name match to what this environment variable is pointing to. Check it on the system before erasing anything so you know what it's supposed to be pointing at when you write your automation scripts.

              • 4. Re: How to pass arguments to adcfgclone to automate cloning process
                Shareef Khaleel

                Dear Maynard,

                 

                Sorry for delay; but it was for preparing production and clone server scripts with testing.

                 

                running:

                $perl adcfgclone.pl dbTier clone_dbclone.xml

                 

                gives following error:

                adcfgclone: unrecognized action specified: "clone_dbclone.xml"

                 

                 

                Thanks and Regards,

                Shareef

                • 5. Re: How to pass arguments to adcfgclone to automate cloning process
                  Maynard with Xenemm

                  Please try giving the full path to clone_dbclone.xml

                   

                  For reference, this is the portion of the script I user for cloning the database. You'll also need to pass the apps password to the script:

                   

                  perl adcfgclone.pl dbTier $CONTEXT_FILE << CLONE

                  $EBS_APP_PASS

                  CLONE

                   

                   

                  The variables are defined in another file that my script sources.

                  • 6. Re: How to pass arguments to adcfgclone to automate cloning process
                    Shareef Khaleel

                    It's the same, please check attached file.

                     

                    Thanks and Regards,

                    Shareef

                    • 7. Re: How to pass arguments to adcfgclone to automate cloning process
                      Maynard with Xenemm

                      You're missing the action keyword "dbtier" before the $CONTEXT_FILE parameter.

                      • 8. Re: How to pass arguments to adcfgclone to automate cloning process
                        Shareef Khaleel

                        You are right...sorry for that..

                         

                        Please:

                        1. How to pass apps password?

                        Can we save it in another file, or can we pass it as option within

                        $perl adcfgclone.pl dbTier $CONTEXT_FILE

                         

                        2. Why error

                        RC-20403: The following port numbers are busy - please make sure the ports are available and try again.

                        Raised by oracle.apps.ad.clone.ApplyDBTechStack

                        s_dbport : 1522

                        appears; although old clone folder is deleted (rm -Rf d01) and we are creating fresh clone? and how to overcome this issue; since we will create context file one time only and it will not be updated later (changing db port number each time we create new clone).

                         

                         

                        Thanks a lot and Regards,

                        Shareef

                        • 9. Re: How to pass arguments to adcfgclone to automate cloning process
                          Maynard with Xenemm

                          1) Create a separate file called clone.env that is read only to the oracle user with the following entry:

                          EBS_APP_PASS=replace_this_with_your_apps_password

                           

                          Change your script to the following:

                          . clone.env

                          perl adcfgclone.pl dbTier $CONTEXT_FILE << CLONE

                          $EBS_APP_PASS

                          CLONE

                           

                          2) Did you shutdown the listener before deleting the oracle home? It looks like there is a process already using port 1522 on the server. You need to kill the process before the clone can complete. the port number is not changing every time you do a clone. The perl script is validating that the system is ready before executing the clone and it found something blocking it for completing.

                          • 10. Re: How to pass arguments to adcfgclone to automate cloning process
                            Shareef Khaleel

                            Dear Maynard,

                             

                            1. I will create a file with one line:

                               EBS_APP_PASS=PASSWORD

                            2. Can you elaborate more regarding:

                                Change your script to the following:

                                 . clone.env (Should i run this file:  $. ./clone.env)

                               then

                                 perl adcfgclone.pl dbTier $CONTEXT_FILE << CLONE

                                 $EBS_APP_PASS (What is this for; when should i do that?)

                                 CLONE (What is this for; when should i do that?)

                             

                            3. You are right; i didn't stop listener; i will do next time when completing all script.

                             

                            Thanks In advance,

                            Shareef

                            • 11. Re: How to pass arguments to adcfgclone to automate cloning process
                              Maynard with Xenemm

                              I'd assumed that you were automating the clone process into a script and the 4 lines I typed out would be cut and pasted into that script. The entry in the clone.env will setup an environment variable called EBS_APP_PASS. When you run ". clone.env" it's the same as "source clone.env" which will create the environment variable in your current session. This will have your apps password in it. From a security standpoint, you typically don't want to type out your password on a command prompt as then anyone on the system can run ps -ef and see the password on the process list.

                               

                              If you are running the command interactively, you can enter the password when prompted.

                              Alternatively you can cut and paste those 4 lines at the prompt.

                               

                              1 person found this helpful
                              • 12. Re: How to pass arguments to adcfgclone to automate cloning process
                                Shareef Khaleel

                                Thanks a lot;

                                 

                                A. This is the final script for dbTier:

                                 

                                #!/bin/sh

                                #Help: Script to Start new cloning; as part of cloning automation program

                                #Duration:  X Hours.

                                #Last Update Date: Monday, 17.7.2018

                                cp -v /home/oracle/Documents/clone_clonedb.xml /home/oracle/d01/oracle/PROD/db/tech_st/11.1.0/appsutil/ >> /backup/clone-automation/Cloning-adcfgclone.log  2>&1

                                CONTEXT_FILE="/home/oracle/d01/oracle/PROD/db/tech_st/11.1.0/appsutil/clone_clonedb.xml"

                                export CONTEXT_FILE

                                CONTEXT_NAME="clone_clonedb"

                                export CONTEXT_NAME

                                echo $CONTEXT_FILE >> /backup/clone-automation/Cloning-adcfgclone.log 2>&1

                                echo $CONTEXT_NAME >> /backup/clone-automation/Cloning-adcfgclone.log 2>&1

                                cd /home/oracle/scripts

                                . ./clone.env

                                cd /home/oracle/d01/oracle/PROD/db/tech_st/11.1.0/appsutil/clone/bin

                                perl adcfgclone.pl dbTier $CONTEXT_FILE << CLONE

                                $EBS_DB_PASS

                                CLONE

                                #Update paramters sessions, SGA, PGA then shutdown and restart db

                                END OF SCRIPT

                                 

                                clone_clonedb.xml: from the last interactive cloning

                                 

                                B. appsTier: i didn't start yet;

                                 

                                Thanks and Regards,

                                Shareef