What is patch?
Patch is a program to fix a particular problem or enhance/add a particular feature in existing program/product/software.In Oracle to apply database patch we use ‘opatch‘ ($ORACLE_HOME/OPatch) where as in order to apply applications patch we use ad utility ‘adpatch‘ ($AD_TOP/bin).
Before going on steps for patching just a brief on Maintenance Mode, Maintenance Mode is mode of operation introduced with AD.I.2, in which the oracle application system is made accessible only for patching activities. Greatly improves performance by minimizing downtime.
If you wish to apply patch without putting applications in maintenance mode (for small patches) use
options=hotpatch with adpatch.
Here I am explaining basic steps that are performed in patching :
STEP 1
Before applying a patch you must check whether the patch is already there or not. For this
we query the database:
*sqlplus apps/<apps password>@<tnsalias> then
SQL> select * from AD_BUGS where bug_number=’<patch number>’
Check invalid object
SQL>
SELECT owner || ', ' || object_type || ', ' || object_name FROM
sys.dba_objects WHERE status = 'INVALID'
;
SQL> select * from
dba_objects where status='INVALID';
STEP 2
Download the patch.
*login to oracle metalink.(www.metalink.oracle.com)
*Select the patches option then select the search type.
*Query for patch by writing the patch no. & platform on which you want to download the patch.
*Click download .
If you have downloaded the patch at desktop then move it to directory where you want it to unzip.
mv <patch.zip> <destination patch directory>
eg: mv p4003579_linux.zip /u1/apps/patch
STEP 3
Unzip the patch. For this
*log in as application tier user.
*Go to the directory where you have your patch directory & type command-
unzip patch.zip
This will unzip the patch in current directory & will make the required patch directories & sub directories.
STEP 4
Enable the Maintenance Mode.For This:
*Set the environment file located in APPL_TOP.
*Run the ad administration utility by typing adadmin on unix/linux console. It will ask questions related to admin utility with default answers in brackets.Then it shows following options & ask for the choice:
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.
The status of maintenance mode is displayed at the top of change maintenance mode menu.Again it will show following options & ask for choice:
1.Enable Maintenance mode.
2.Disable Maintenance mode.
3.Return to Main Menu.
Select option 1. Then return to console.
STEP 5:
Run autopatch from the patch directory by entering the following command:
Command-- $ adpatch
Command-- $
adpatch options=hotpatch
Command-- $
adpatch options=noautoconfig
Command-- $ adpatch options=hotpatch,noautoconfig
$ adpatch
Your default directory is
'/u01/apps/apps_st/appl'.
Is this the correct APPL_TOP [Yes] ?
Filename [adpatch.log] : 12983048.log
Do you wish to activate this feature [No] ?
Please enter the batchsize [1000] :
using ORACLE executables in
'/u01/apps/tech_st/10.1.2'.
Is this the correct database [Yes] ?
Enter the password for your 'SYSTEM' ORACLE schema: <Enter system password>
Enter the ORACLE password of Application Object Library
[APPS] : <Enter Apps password>
The default directory is [/home/patch/12983048] :
u12983048.drv
Please enter the name of your AutoPatch driver file :
u12983048.drv
Do you wish to apply this patch now [No] ? yes
Enter the number of parallel workers [8] :
AutoPatch is complete.
AutoPatch may have written informational messages to the
file
/u01/apps/apps_st/appl/admin/QA/log/12983048.lgi
Errors and warnings are listed in the log file
/u01/apps/apps_st/appl/admin/QA/log/12983048.log
and in other log files in the same directory.
***************************END*******************************
No comments:
Post a Comment