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).
For Basic Apps patches terminology & other related details please refer to the following links:
http://onlineappsdba.com/index.php/2006/08/10/oracle-apps-patch-basics/
http://onlineappsdba.com/index.php/2006/08/11/oracle-apps-patch-basics-ii/
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
select * from AD_BUGS where bug_number=’<patch number>’
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:
$ adpatch
After this answer the questions of autopatch. As autopatch finishes its tasks, it writes timing information to the AD timing report for jobs running in parallel (if any ) and reminds you to run the log files for any errors.
If you don’t see the “autopatch is complete” message at the end of the Autopatch log file, Autopatch did not complete successfully.
The most important step after autopatch completes is to check the log files for any errors that may occurred during the patching process. Check the main Autopatch log file first,then additional log files as necessary.
The default name of main autopatch log file is adpatch.log .The file is located in
$APPL_TOP/admin/<SID>/logQuestion for readers :
What is lgi file in log location (above directory)





Good hands-on exercises (installation, patching, cloning), very experienced trainer worth every penny 
29 users commented in " Oracle PATCHING : adpatch , Maintenance Mode "
Follow-up comment rss or Leave a TrackbackHi the answer for the questio “What is lgi file in log location (above directory)” is:
The file adpatch.lgi is the file that has information (about patch applyed), for example, about files that were not applyed because of some kind of problem that occurs.
Best regards,
Paulo Portugal.
Hi Neha,
It was recommended to shutdown apps tier if i want to patch ebs using adpatch, how much importance do you think to shutdown apps tier before you patch any ebs environment. Is it recommended or is it good to shutdown the apps tier? what sort of benefit will i have if i have to shutdown apps tier? thanks in advance.
Hasnain
Hi Hasnain,
When maintenance mode is enabled,you cant access applications in any case.But if we shutdown it then the operating system resources can be used for patching which will improve the performance,hence it is recommended to shutdown apps tier before you patch any ebs environment.
Regarding benefit,you cant observe it for small patches but improvement in performance can be observed for big patches.
Hope this answers your question.
Regards
Neha
Hi,
If u enable maintenance mode and shut down apps tier services…things like concurrent manager may takes a while to shut down and take some time for start up as well.To avoid that oracle provided us the maintenanace mode option where in we can let the concurrent managers run their jobs and we can apply the patch in an optimal fashion without shutting down the appstier services.
Hi,
As Neha explained above is valid point. Also strath25 explained is correct too.
Answer to both you guys said above is thumb rule is if readme of the patch suggest you to bring the services down only in that case you need to bring the services down otherwise hot patch is the best option.
Also it is good practice to bring the Apps down to avoid any kind lock conflicts etc.
It all depeneds on urgency of the patch required and testing team is waiting for the Application. It is your call how want to go about it.
Regards
Ramnik Gupta
hi
im rabiya
i have a doubt on log files.
when open the logfile it is not in text format then
how can i rectify the errors.
please tell me.
Hi Rabiya
Log files are meant to analyze whether the patch applied correctly or not , if not you can look into possible errors, but you can’t rectify errors by editing log files.
Log file lists the possible areas of error while applying patch or performing any activity.
Very informative, I could follow the steps for applying the patch for 7303030. But got stuck with Step 2, I didn’t know where to unzip the files.
Also how will the system know when we run the “adpatch” command that which patch is to be applied and where it is located. it is asking for a drive name which probably this might be the pointer to that. Also is the location hardcoded ?
Please guide me through.
@Muthu
Q. I didn’t know where to unzip the files
You can unzip patch anywhere (only requirement is that application tier user default applmgr) should have r/w access on this unzip location
Q. How will the system know when we run the “adpatch” command that which patch is to be applied and Where it is located ?
adpatch will prompt you location of patch and driver name (file with drv extenstion) inside patch unzip location.
Q. Is the location hardcoded ?
No patch location is not hardcoded in adadmin utility
i recently installed an R12 instance. I am trying to apply the patches to upgrade to 12.1.1. i guess I have forgotten the SYSTEM oracle schema password. How can i handle such a situation. Please help me resolve this. i guess I have posted in another topic sorry guess it is at the wrong place.
Other than SYS oracle user account, you could try “Alter User SYSTEM identified by ” from the back end.
Hi Muthu,
What Atul said is correct you can do it by using alter user system identified by xxxx from the database backend.
very informative and detailed information thankyou !
keep posting more stuff in the same way .
Hi All,
I want to add in this thread about one of the usually occured adpatch error in R12. Sometimes adpatch session seems to be in a hanged state as no progress seems. In that case you should check its logfile. There may some backend database related issue error message registered. For example once I see:
/appl/ad/12.0.0/sql/adutlrcmp.sql APPLSYS ***** APPS ***** ***** 16 0 NONE FALSE
ERROR:
ORA-28000: the account is locked
Then as a sys User you should edit the APPS database profile (dba_profiles) and set the resources accordingly.
So my recommendation is always tail the logs for any maintenance activities.
Regards,
Muhammad Umair Nazir
Hi Atul,
Having one Query
Which Tables get locks while adpatch Running
warm Regards
Sukesh
Hi
Before you apply Oracle apps patch you need also to check patch prerequisites from metalink and install them, otherwise you can miss required patches.
Regards,
Pavel
Hi
I found very useful tool to check Patch prerequisites called Patchdepends( http://www.patchdepends.com) does somebody heared about it?
While applying patch , developer are login into the sytem and working . I would like to apply the patch in cold mode (means only the patch workers will be running and no users such as developer could log on to the system) . How to arrest the incoming of developers while applying the patch. Kindly suggest. Hope you are able to get my point
@ Narayana,
With particular AD patchset you must put your system into maintenance mode using adadmin. Putting system in to maintenance mode will prevent users using system.
If you are on older version of apps shutdown application tier services (dataabase and database listener should be up while applying apps patches)
Hi Neha,
** I saw the patch can be applied in Hot Mode by giving option=hotpatch. Can this be used in version 11.5.10.2 .
** Also let me know how to avoid the Developers getting into the Database while applying the patch as the listener should be up while applying the patch. Do you have any answer, Please revert back.
@ Narayana,
Yes options=hotpatch is available in 11.5.10.2 as well (Options for ADPATCH depends on AD verison/patchset)
If you want developers not to login to database during patching then configure Firewall between development PCs and database and block database listener port.
Hi Atul,
** Thanks for the clarity. We are into ADI-7. Kindly let me know whether this supports hotpatch option .
@ Narayana,
AD (Application DBA) is different from ADI (Application Desktop Integrator)
To find if options=hotpatch is available simply run adpatch with this option and you will see error if this option is not supported.
Thank you for sharing ur knowledge but tell me why to go for maintainance mode if application is down anyways it is not accessible to user .Please clear it .
In adpatch,If the application services are down the maintenance mode should be enable, why?
@babu,
In new adpatch versions, if patch is not applied in hotpatch mode then adpatch utility checks if maintenance mode is enabled or not. If maintenance mode is not enabled then adpatch promots user to enable maintenance mode and re-run adpatch utility.
Hai neha this information is very much usefull for me.
Thank u
Pratheek
Hai atul can u please tell me what is full table scan and stats gathering?
@Pratheek,
In simple terms full table scan means– when user runs a query like “select X,Y,Z from table_name where x=4″; then sql scans through all rows (of table in absence of indexes) then this is called as full table scans. You can put indexes (for column in where clause) to avoid full scan. (For large table full scan can take lot of time).
Optimizer in Oracle uses statistics (stored in data dictionary) to estimate how much I/O and memory are required to execute a SQL statement using a particular execution plan. statistics gathering provides the optimizer with information about schema objects.
Check more here http://www.orafaq.com/node/39 and here http://docs.oracle.com/cd/A87860_01/doc/server.817/a76992/stats.htm
Leave A Reply