Header Ads Widget

How to apply new patch while adpatch is already running.





All Oracle apps DBA are applying adpatches frequently to fix issue, upgrade application patches, etc....

Some condition happens when applying patch like missed prereq patches, patch failed while applying patch and found to apply new patch to fix issue etc.

Now in such scenario, we can resume old adpatch session after apply new patch.

Perform following steps to apply new patch while adpatch is already running:


1.  Shutdown/Quit workers.

     Using adctrl utility, Shutdown/quit workers.

     $ adctrl

     Enter option 3 to quit workers.

                 AD Controller Menu
     ---------------------------------------------------
     1.    Show worker status
     2.    Tell worker to restart a failed job
     3.    Tell worker to quit
     4.    Tell manager that a worker failed its job
     5.    Tell manager that a worker acknowledges quit
     6.    Restart a worker on the current machine
     7.    Exit
  
     Enter your choice [1] : 3



2.  Take backup of following tables.

     $ sqlplus apps/apps


     SQL> create table fnd_install_process_Nit_bkp as select * from FND_INSTALL_PROCESSES;
     SQL> create table AD_DEFERRED_JOBS_Nit_bkp as select * from AD_DEFERRED_JOBS;
            

3. Drop tables.

    SQL> drop table FND_INSTALL_PROCESSES;
    SQL> drop table AD_DEFFERRED_JOBS;


4.  Backup the *.rf9 file located in $APPL_TOP/admin/<SID>/restart.

     Better way to take the backup restart directory.

     $ cd $APPL_TOP/admin/<SID>
     $ mv -r restart restart_nit_bkp
     $mkdir restart


5. Apply new patch.

    while applying new patch will prompt you to start previous adpatch session, on first       prompt enter No and in second prompt enter 'Yes' to start new adpatch session.


6. Now, restore *.rf9 files located in $APPL_TOP/admin/<SID>/restart_nit_bkp

    $ cd $APPL_TOP/admin/<SID>
    $ rm -rf restart
    $ cp -r restart_nit_bkp restart


7. Restore the fnd_install_processes and AD_DEFERRED_JOB tables as you backed up in step 2.

     $ sqlplus apps/apps
 
     SQL> create table fnd_Install_processes  as select * from fnd_Install_processes_Nit_bkp;
     SQL> create table AD_DEFERRED_JOB as select * from AD_DEFERRED_JOB_Nit_bkp;

    
     Note: The 2 tables should have the same number of records.    

      SQL> select count(1) from FND_INSTALL_PROCESSES;      
      SQL> select count(1) from FND_INSTALL_PROCESSES_Nit_bkp;

      SQL> select count (1) from AD_DEFERRED_JOB;
      SQL> select count (1) from AD_DEFERRED_JOB_Nit_bkp;


8.  Recreate synonyms.

     $ sqlplus apps/apps

     SQL> create synonym AD_DEFERRED_JOBS for APPLSYS.AD_DEFERRED_JOBS;
     SQL> create synonym FND_INSTALL_PROCESSES FOR  applsys.fnd_install_processes;

9. Now Start adpatch session. it will resume where it stopped previously.




......................Best of Luck guys......................