Sunday 29 December 2013

Applying Adpatch or autopatch and maintenance mode


Application Patch – Adpatch or Autopatch:

Why do we need patch?
  • For fixing a bug.
    • Bug: Customization or by release of new product, bug is encountered.
  • Adding new functionality / new module e.g. supplier management functionality.
  • Applying new product enhancement.
  • Upgrade to higher point release or release (like 12.X.1 to 12.X.2 or 12.1.X to 12.2.X)
  • Upgrading to higher family pack
    • It may contain bulk of patches.
    • Bugs reported by customer.

Patch can be downloaded from metalink in zip format and while we unzip any patch, It contains driver file- which directs adpatch for its activity, readme.txt file which is useful for DBA to apply patch and do analysis with preinstall task and post install tasks.

Patch Utilities:
  1. Command line utility
  2. Web based patch utility – Oracle application manager(OAM)

Command line patch utility are adpatch which is used for applying patch in application tier, admrgpatch which is used to merge multiple patch into single and can be applied the merged patch alone instead of applying all patches individually.

Admsi.pl at AD_TOP/bin :
Script for generating customized installation instruction for a patch that helps in tracking and performing manual steps during patch.
It can be executed in CLI (Command Line Interface) or GUI (Graphical User Interface).

We must do some check before we apply patch as:
  • Check the patch number in table ad_bugs and ad_applied_patches (SQL> select * from AD_BUGS where bug_number=’<patch number>’;)
  • Which module it belongs to and what would be the impact.

Step to apply adpatch:

  1. Download patch from metalink.
  2. Go to patch directory and unzip the patch.
  3. Go through readme.txt file and check for any pre-requisite and post requisite and take care accordingly.
  4. Shutdown the application services. (keep in mind database and listener should be up and running).
  5. Bring the application into maintenance mode using adadmin utility (discussed on later part of this post).
  6. Source the environment ( at App_Base/ apps/ apps_st/ appl/ APPS[SID]_[hostname].env).
  7. Apply the patch with adpatch
  8. Monitor the patch from log file at APPL_TOP/admin/SID/log
  9. Once patch is complete, check both adpatch.log and adpatch.lgi
  10. Disable the maintenance mode.
  11. Start all the application services and check for the patch applied.

How do we apply patch without enabling maintenance mode?
I would say use option=hotpatch and It is used when we apply patch when maintenance mode is disabled.

You can also know more about adpatch modes and options from below link:
http://appsdbaraz.blogspot.com/2013/12/adpatch-modes-and-options.html

Do we need to run autoconfig after patching?
Adpatch takes care of it to update configuration files, if any template files are introduced by the patch.

Do we have to apply patch on all nodes for multimode system?
It depends. In a shared APPL_TOP system, changes made during patching session on one node are immediately available on all nodes.
If APPL_TOP is not shared , then have to apply patch individually to all nodes.

Adpatch.log : main autopatch log file.
Adpatch,lgi : autopatch informational messages.
adworkerXXX.log : for database operations run in parallel and have the worker log details.

Maintenance mode:

Why enable maintenance mode?
Maintenance mode is enabled to ensure optimal performance and reduce downtime during patching session. It shuts down the workflow business event system and set up function security so that oracle applications functions are unavailable to users. This provides a clear separation between normal runtime operation and system downtime for patching.

Enabling Maintenance Mode:

  • Set the environment App_Base/ apps/ apps_st/ appl/ APPS[SID]_[hostname].env.
  • Run the ad administration utility by typing adadmin on unix/linux console.

It will ask a series of questions with application and databse related information along with context file.Then it will show following options:

  1. Generate applications file menu.
  2. Maintain applications file menu.
  3. Compile/Reload Applications Database Entities Menu.
  4. Maintain Applications Database Entities Menu.
  5. Change Maintenance Mode.
  6. Exit ad Administration.

Select option 5. Now it will show the below option:

  1. Enable Maintenance mode.
  2. Disable Maintenance mode.
  3. Return to Main Menu.

Select option 1. Then return to console.

When we enable maintenance mode with adadmin utility, it calls setmmd.sql script located at FND_TOP/sql location. We can also enable / disable maintenance mode with this script.




1 comment:

  1. I was applying Apps patch using ADPatch in R12 for the first time and it helped me a lot. Thanks for sharing.

    ReplyDelete