• Find us:
    +1-669-900-5138   |   +44-203-372-5553
  • Free Newsletter

    Get Latest Updates

  • Make Training Enquiry


  • Categories

  • Archive

  • Oracle PATCHING : adpatch , Maintenance Mode

    Posted by "" in "patching" on 2008-01-23

    Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInEmail this to someone

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

    33 Responses to “Oracle PATCHING : adpatch , Maintenance Mode”

    1. paulofp says:

      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.

    2. Hasnain says:

      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.


    3. Neha Mittal says:

      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.


    4. strath25 says:

      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.

    5. Ramnik Gupta says:


      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

    6. rabiya says:

      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.

    7. Neha Mittal says:

      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.

    8. Muthukumar says:

      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.

    9. Atul Kumar says:


      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

    10. Muthukumar says:

      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.

    11. Ata says:

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

    12. Varun says:

      Hi Muthu,

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

    13. charanmahavadi says:

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

    14. Umair Nazir says:

      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

    15. sukesh says:

      Hi Atul,

      Having one Query

      Which Tables get locks while adpatch Running

      warm Regards

    16. Pavel says:


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


    17. John says:


      I found very useful tool to check Patch prerequisites called Patchdepends( http://www.patchdepends.com) does somebody heared about it?

    18. Narayana Prasad says:

      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

    19. Atul Kumar says:

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

    20. Narayana Prasad says:

      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.

    21. Atul Kumar says:

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

    22. Narayana Prasad says:

      Hi Atul,

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

    23. Atul Kumar says:

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

    24. savita says:

      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 .

    25. babu says:

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

      • Atul Kumar says:

        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.

    26. pratheek says:

      Hai neha this information is very much usefull for me.

      Thank u

    27. pratheek says:

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

      • Atul Kumar says:

        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

    28. Junaid says:

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

      If I have unzipped patch (p10627713_R12.ZX.B_R12_is.zip) 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:

        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

    29. Junaid says:

      Thanks dear Kumar,

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

      Thanks once again.


    30. kishore says:

      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 .

    Leave a Reply

  • K21 Technologies is among the most experienced Oracle Gold Partner for Identity Access Management service providers. We work with application development companies and in-house technology division to help achieve significant returns on their IT security investment. Our clientele includes some of the globally renowned corporate, which speaks of our expertise in our field.

    We have the most talented and experienced team that can swiftly deploy security solutions even in complex IT ecosystem. Our clients highly appreciate our timely implementation, interactive training, on-demand support and community resources.

    K21 Technologies
    8 Magnolia Place, Harrow,
    London, HA2 6DS

    UK: +44(0)7476444481
    USA: +1-888-414-1821

  • 2014, K21 Technologies. All rights reserved DMCA.com
  • TOP