|
Monday, April 6, 2009 |
Using AD Patch |
Using AD Patch The administrative tool used to apply application patches is AD Patch, also referred to by its command line executable, adpatch. Basic information about the AD Patch utility can be found in Oracle MetaLink Note 181665.1, “REL11i ADPATCH BASICS.” The AD Patch utility will spawn off a user-determined number of worker threads or patch worker processes to update application code by copying later versions of programs to the application tier; updating database objects, regeneration application forms, and reports; and performing some post-patching steps. The code changes are determined by the patch’s driver files.
■Oracle Aplication DBA Portal Tip: Prior to executing adpatch, disable any password constraints defined within the application or database. These constraints could cause errors if the patch creates a new user account. You may also need to reset some standard Oracle passwords for accounts such as CTXSYS.
An Oracle Applications DBA needs to be familiar with the options available for the AD Patch utility. The parameters supported by the adpatch command differ depending upon the AD Minipack level applied with Oracle Applications. When upgrading the AD product group, be sure to identify and understand any new features of the AD Patch utility. Study the adpatch command parameters for any possible benefits. Use the command adpatch help=y to see the available options.
In order to enable an option with adpatch, use the following syntax:
adpatch options=[option1, option2..]
The adpatch options shown are commonly used to accelerate the patching process.
Option Purpose Novalidate :Prevents adpatch from validating all schema connections Noprereq :Prevents adpatch from checking the existence of prerequisite patches Nocompiledb :Prevents adpatch from compiling database objects Nocompilejsp :Prevents adpatch from compiling JSP objects Noautoconfig :Prevents adpatch from running autoconfig after the patch has completed Nogenerateportion :Prevents adpatch from compiling forms, menus,and plls Hidepw :Prevents passwords from being displayed in log files Hotpatch Allows adpatch to be run when the instance is not in maintenance mode
■Oracle Aplication DBA Portal Tip: If you are applying a large number of patches, use the options nocompilejsp,nocompiledb, noprereq, and novalidate to speed up the application of the patches. Recompiling Java Server Pages (JSP) pages and database objects can be performed at the end of the patching process. In this situation, placing the database in noarchivelog mode may also improve patching performance.
Having changed directory to the location where the patch driver(s) is located, you can then start the patching session as the instance owner by executing adpatch with the desired options:
adpatch options=nocompiledb,novalidate
When adpatch is started, the user must respond to several questions. These questions serve to verify application file settings, database connectivity, and patch driver options. For example, the user may set adpatch to send an email upon failure. The following questions from adpatch require additional explanation:
Question: Filename for AutoPatch Log Recommended response: Rather than use the default name of adpatch.log, use a more descriptive name, such as [c|d|g|u][patch#]. log. For multi-node or multi-language patching, you should consider including the server name and language in the filename. Additional descriptions may also be added depending on your environment.
Question: The default directory is [current working directory] Recommended response: It is advised that you run the adpatch utility from the directory where the patch has been unbundled. By doing this, the default value for this question can be chosen. Otherwise, enter the directory where the patch was unbundled.
Question: Please enter the name of your AutoPatch driver file Recommended response: This depends upon the patch being applied. Most patches from Oracle now contain a single u driver. If the patch contains c, d, and/or g drivers, adpatch needs to be run for each driver. The drivers need to be applied in alphabetical order.
Question: Number of parallel workers Recommended response: This value is environment-specific and should be adjusted accordingly.
Using a defaultsfile will allow for noninteractive patching by providing responses to the adpatch questions. The defaultsfile option of adpatch must point to a file in the $APPL_TOP/admin/$CONTEXT_NAME directory. This option is typically used with the mode interactive=no.
Performing Manual Steps If any part of the patching process requires numerous manual steps, it is useful to create scripts to automate the manual commands. This can not only help reduce the chances of human error during the patching process, but scripting can also speed up the process. For ease of management, you should create a special directory to be the home directory for such scripts. During the creation of the scripts, be sure to include logging commands as well as parameters for values such as instance name. When you parameterize such variables, the scripts can be executed with each patching effort without requiring modifications.
For example, you may build a script of manual steps that looks similar to the following template:
SCRIPT_TOP=/patch/scripts/project_a INSTANCE_NAME=$1 LOG_TOP=$SCRIPT_TOP/logs script_1.sh > $LOG_TOP/post_steps.log command_1 >>$LOG_TOP/post_steps.log script_2.sh $INSTANCE_NAME >> $LOG_TOP/post_steps.log exit
In the preceding example, script_1.sh may be a script that performs a backup of library files, and script_2.sh could be a script that relinks several forms.
When the script has executed, thoroughly review the log files generated by the script. New failures may be encountered on some instances that had not occurred during past patch applications. Resolve any errors before proceeding to the next steps. Scripts created for such steps should contain error handling, such as checking the number and types of parameters Custom scripts should also contain documentation to describe the purpose of the script.
The scripts you create should be included in the spreadsheet as part of the process for applying the patch. Part of the documentation process for the patching effort involves using descriptive script and variable names. Writing scripts is a useful skill set for Applications DBAs. We recommend you practice coding scripts on test servers while connected as a user with a low level of permissions until you become more comfortable with scripting. Always test your scripts thoroughly before running them on production systems.Labels: Using AD Patch |
posted by Srinivasan .R @ 3:49 AM |
|
3 Comments: |
-
Nice post Srinivasan , but I would like you to explain me on this statement "The drivers need to be applied in alphabetical order."
As far as I know it is just a coincidence that the drivers are named c,d,g and u. But that doesn't mean they will be applied in ALPHABETICAL ORDER.It is very misleading for newbies.
-Thanks and Regards, Sandeep
-
can please share oracle apps working environment configsrstion .. not your working environment configaration change the names of prod ,dev, qat,uat names and how many db normally lvel3 companys share me ..
-
|
|
<< Home |
|
|
|
|
|
Nice post Srinivasan , but I would like you to explain me on this statement "The drivers need to be applied in alphabetical order."
As far as I know it is just a coincidence that the drivers are named c,d,g and u. But that doesn't mean they will be applied in ALPHABETICAL ORDER.It is very misleading for newbies.
-Thanks and Regards,
Sandeep