Tuesday, 6 December 2016

Adpatch Modes and Options?

My main focus on this post would be discussing all the options of adpatch and modes of adpatch.

Modes of adpatch:  
  1. Interactive mode
  2. Non-Interactive mode
  3. Test mode
  4. Pre-Install mode
Interactive Mode:  
It is the default mode of adpatch when we don’t use anything. We can apply patch in this mode by going into patch directory and simply type adpatch in command prompt and hit enter.

Non-Interactive:
We can apply in this mode as:
$adpatch Interactive=no
It uses default files to store prompt values and can be applied from patch directory.

Test Mode:
This mode is purposely used to check the what exactly patch is doing and will do everything without actually changing anything.
We can apply patch in this mode as:
$adpatch apply=no
By default apply=yes

PreInstall Mode:
This mode is used to apply adpatch for any upgrade or consolidated update of utilities itself. So, it would be suggested to apply pre-install patch first.
When we apply patch in preinstall mode, it updates all AD utilities befre upgrade or update.
We can apply adpatch in this mode as:
$adpatch preinstall=y

Adpatch Options:

We have multiple adpatch options and based on the requirement we can use specific options. Here, I will try to cover most often used adpatch options.

Noautoconfig:
$adpatch options=noautoconfig
This options is used to skip the autoconfig execution as by default it executes the autoconfig and updates the configuration file if any template file is added. This option is helpful when we apply multiple adpatch and they are not merged.

Nocompiledb(without compiling database):
While we apply adpatch, It may create invalid objects and by default adpatch compiles the invalid objects after patch application. But in case you do not want to compile invalid objects to ensure the minimal autopatch time, you can apply adpatch as below:
$adpatch options=nocompiledb

Nocopyportion:
This option is used to apply adpatch without copying the files present in copy driver. This can be applies as:
$adpatch options=nocopyportion

Nocompilejsp:
Adpatch also compiles the java server pages(JSP) after completion of patch application and can be skipped using the option nocompilejsp as below:
$adpatch options=nocompilejsp

Nodatabaseportion:
Nodatabaseportion option is used to skip the adpatch the activity of database driver. It can be used as:
$adpatch options=nodatabaseportion

Nogenerateportion:
Nogenerateportion option is used to skip the adpatch activity of generate driver portion of the patch  and you can use the option nogenerateportion as below:
$adpatch options=nogenerateportion

Maintenance Mode disabled:
If you want to apply your adpatch without enabling maintenance mode, you can apply using the option as hotpatch as below:
$adpatch options=hotpatch


Nolink:
Nolink option is used to skip the relinking and can be used as:
$adpatch options=nolink

Nogenform:
Nogenform option is used to skip the generate form file and can be used as:
$adpatch options=nogenform

Maintainmrc:
Maintainmrc is used for adpatch to execute the maintain MRC schema as part of patch. By default maintain MRC is done for standard patch and is disabled for documentation and translation patches.
$adpatch options=nomaintainmrc

Noprereq:
This option is used to skip the checking of pre-requisite patches and by default it checks for pre-requisite patch. This option can be used as below:
$adpatch options=noprereq

What is difference between AD_BUGS and AD_APPLIED_PATCHES ?

ADPatch 

Applying a patch updates your existing system in various ways, from adding a new
feature or product to improving system performance.

patches are applied for a number of reasons, including:

■ Fixing an existing issue
■ Adding a new feature or functionality
■ Updating to a higher maintenance level
■ Applying the latest product enhancements
■ Providing interoperability to new technology stacks
■ Determining the source of an issue
■ Applying online help

Depending on the type of patch, it may update the file system, or the database, or
both.

Applying a Patch:

Step 1 -Download the patch from metalink
It is better to check the table 'AD_BUGS' if the patch is already applied then no need to apply again.
you can check list of applied patches as follows:
  select *from ad_bugs where bug_number = 'patch_number';
select *from ad_applied_patches where APPLIED_PATCH_ID = 'patch_number';
if this query returns any row then it means this patch is already applied.

to see the difference between 'AD_BUGS' and 'AD_APPLIED_PATCHES'.
AD_BUGS: 
=========
Holds information about the various Oracle Applications bugs whose fixes have been applied (ie. patched) in the Oracle Applications installation.


AD_APPLIED_PATCHES:
===================
Holds information about the "distinct" Oracle Applications patches that have been applied. 


If 2 patches happen to have the same name but are different in content (eg. "merged" patches), then they are considered distinct and this table will therefore hold 2 records.

Step 2 -Check all Per-requisites from read me file. First apply all the patche(s) which are listed in pre-requisites (if any) and then apply the required patch and if there is/are any patch suggested in post-requisite then apply those too.


  
Step -3 Check successful patch completion condition from read me file.


(If successful patch condition already meets then no need to apply the patch.)

Step -4 Upload the patch in patch directory (i.e /appshome/patch) in zip format

Extract the patch through following
unzip <file name>

Step -5 Down the application services of concerned instance. Or do exactly what else is written in "Pre-requisite" if any.

Step -6 Run .env file of concerned instance. (Optional)
e.g (/appshome/appsuat1/UAT1/apps/apps_st/appl/APPSUA T1_erpappdev.env)

Step -7 Go to the directory of patch location  /appshome/patch (i.e cd /appshome/patch)
  
Step -8 Enter the command adadmin, following command lines will appear after adadmin.

                                                                 
Press ENTER for default value.



   
(Enter the log file name with extension .log or Press Enter for default value)


Press ENTER for default value, if you enter yes means the failure activities occurred in mail.


Press ENTER for default batchsize value.


(Press ENTER for default value)


Enter the system password usually its password is  'manager'.


Enter the SYSTEMApps  Password or Press ENTER for DEFAULT.


 Enter 5 as your choice  Change Maintenance Mode.



Enter 1 as your choice  Enable Maintenance Mode.
Enter 3 as your choice  Return to main menu.

   
Enter 6 as your choice for Exit adadmin area location.
  
Step -9 Enter the command adpacth in that patch location.


Press ENTER for default APPL_TOP value.


Enter the adpatch log file name with extension .log


Press ENTER for default value.


 Press Enter for default batch size.


 Enter the SYSTEM Password by default MANAGER.


 Enter the apps password.


 Select or enter your directory where patch is placed.


Enter the driver file name placed in patch directory with .drv extension.

* Auto patch process will start now, follow the following steps after completion of auto patch.
The Final result will come like,
AutoPatch is complete.
AutoPatch may have written informational messages to the file
/appshome/appstest/apps_st/apps/admin/TEST/log/uxxxxx.drv.lgi
Errors and warnings are listed in the log file
/appshome/appstest/apps_st/apps/admin/TEST/log/uxxxxx.drv.log
and in other log files in the same directory.

Step -10 Enter the adadmin command again to disable maintenance mode.
         
         Repeat complete Step 8 and follow the following screen


Step -11 Bounce the services of DB.

Step -12 Bring up the application services.


Step -13 Check the error in patch log file in mentioned location.