Oracle PATCHING : adpatch , Maintenance Mode

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:

 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.(
*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 <> <destination patch directory>
eg:  mv /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-   

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)

Share This Post with Your Friends over Social Media!

About the Author Neha Mittal

Leave a Comment:

paulofp says January 23, 2008

Hi 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.

Hasnain says January 24, 2008

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.


Neha Mittal says January 25, 2008

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.


strath25 says January 31, 2008

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.

Ramnik Gupta says April 5, 2008


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.

Ramnik Gupta

rabiya says December 11, 2008

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.

Neha Mittal says December 12, 2008

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.

Muthukumar says July 27, 2009

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.

Atul Kumar says July 28, 2009


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

Muthukumar says August 15, 2009

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.

Ata says September 3, 2009

Other than SYS oracle user account, you could try “Alter User SYSTEM identified by ” from the back end.

Varun says March 10, 2010

Hi Muthu,

What Atul said is correct you can do it by using alter user system identified by xxxx from the database backend.

charanmahavadi says March 25, 2010

very informative and detailed information thankyou !
keep posting more stuff in the same way .

Umair Nazir says April 11, 2010

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
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.

Muhammad Umair Nazir

sukesh says July 16, 2010

Hi Atul,

Having one Query

Which Tables get locks while adpatch Running

warm Regards

Pavel says September 27, 2010


Before you apply Oracle apps patch you need also to check patch prerequisites from metalink and install them, otherwise you can miss required patches.


John says October 2, 2010


I found very useful tool to check Patch prerequisites called Patchdepends( does somebody heared about it?

Narayana Prasad says November 22, 2010

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

Atul Kumar says November 22, 2010

@ 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)

Narayana Prasad says December 1, 2010

Hi Neha,

** I saw the patch can be applied in Hot Mode by giving option=hotpatch. Can this be used in version .

** 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.

Atul Kumar says December 1, 2010

@ Narayana,
Yes options=hotpatch is available in 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.

Narayana Prasad says December 3, 2010

Hi Atul,

** Thanks for the clarity. We are into ADI-7. Kindly let me know whether this supports hotpatch option .

Atul Kumar says December 3, 2010

@ 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.

savita says June 7, 2012

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 .

babu says October 21, 2012

In adpatch,If the application services are down the maintenance mode should be enable, why?

    Atul Kumar says October 21, 2012

    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.

pratheek says February 10, 2013

Hai neha this information is very much usefull for me.

Thank u

pratheek says February 10, 2013

Hai atul can u please tell me what is full table scan and stats gathering?

    Atul Kumar says February 10, 2013

    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 and here

Junaid says June 14, 2013

Hi Neha,
Kindly let me clear one point here. I am bit confused:

If I have unzipped patch ( at the following path (which creates directory with the name ‘10627713_IS’ in ‘patches’ folder).


should I execute adpatch command at the same path i.e. /home/oracle/patches/10627713_IS

Moreover, upon execution of adpatch command, system prompts for default APPL_TOP directory, with the default option: /u01/app/oracle/AKBLPRD/apps/apps_st/appl

So, what I should enter here.

1) /home/oracle/patches/10627713_IS


2) /u01/app/oracle/AKBLPRD/apps/apps_st/appl

Kindly clear this point.

Thanks in advance


    Atul Kumar says June 14, 2013

    should I execute adpatch command at the same path i.e. /home/oracle/patches/10627713_IS

    AK: You can run adpatch from any location but when it prompts for driver file , give location of complete path (not relative path)

    Moreover, upon execution of adpatch command, system prompts for default APPL_TOP directory, with the default option: /u01/app/oracle/AKBLPRD/apps/apps_st/appl

    So, what I should enter here.
    1) /home/oracle/patches/10627713_IS
    2) /u01/app/oracle/AKBLPRD/apps/apps_st/appl

    AK: Give you APPL_TOP directory , I am assuming your appl_top directory is /u01/app/oracle/AKBLPRD/apps/apps_st/appl

    If you are not sure about APPL_TOP directory then run echo $APPL_TOP

Junaid says June 14, 2013

Thanks dear Kumar,

You people are really nice. You help others who are stuck and need help.

Thanks once again.


kishore says November 13, 2013

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 .

Wilson says December 11, 2014

Do I have to run adadmin on all nodes of oracle application?

dj soiree mariage Bromont says February 20, 2015

Hey there, I think your website might be having browser compatibility issues.
When I look at your blog in Safari, it looks fine but when opening in Internet Explorer, it has some
overlapping. I just wanted to give you a quick heads up!
Other then that, amazing blog!

ravi_111 says July 8, 2015

Hi experts,

I have one question for you. Suppose I have 3 patches to apply, how many time i should enable maintenance mode?

    Atul Kumar says July 8, 2015

    @Ravi_111, It depends if you apply all three under same downtime window then you enable maintenance mode, apply all three patches and take application out of maintenance window. If patches need to applied after few days gap and user needs to access app then you handle that by enable maintenance mode, apply first patch take application out of maintenance window and test application and then same cycle for patch 2 and 3 . I hope this is clear .

Yaazdani says July 10, 2015

I agree with Atul

usha Alla says March 21, 2017

I have been searching many docs But still did nt find the answer

i have same doubt

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 .

Add Your Reply