OPatch Utility Reference

By default, the OPatch utility is located in the Oracle_home/OPatch directory. The following shows the syntax for running the OPatch utility:

opatch [-help] [-report] [command]

where:

  • -help lists the commands and options supported by the utility.

    Use the -help parameter together with a command to view detailed information for the OPatch command. For example:

    opatch apply -help
    
  • -report prints the actions without executing the command.
  • command is one of these OPatch commands:
    • apply [PatchDirectory]

      This command applies the patch to the software located in Oracle_home. If you do not run the utility from the directory in which the patch content resides (PatchDirectory), include the complete path to the directory.

      For the command to work properly, the ORACLE_HOME environment variable must be set to Oracle_home. See Dealing with Conflicts When You Run the Apply Command.

    • lsinventory

      This command displays your system's OPatch and Oracle Universal Installer versions and directories, and lists the patches currently installed in Oracle_home. The following shows sample output for the lsinventory command:

      ----------------------------------------------------------------------
      Oracle Interim Patch Installer version 13.9.4.2.6
      Copyright (c) 2021, Oracle Corporation. All rights reserved.
      
      Oracle Home          : Oracle_home
      Central Inventory    : /export/oraInventory
         from              : Oracle_home/oraInst.loc
      OPatch version       : 13.9.4.2.6
      OUI Version          : 13.9.4.0.0
      Log file location    : Oracle_home/cfgtoollogs/opatch/opatch2021-11-24_06-53-05AM_1.log
      
      OPatch detects the Oracle Home as "Oracle_home"
      
      -----------------------------------------------------------------------
      Interim patches (2) :
      
      Patch 33416881 : applied on Wed Nov 24 06:53:05 GMT 2021
      Unique Patch ID: 24443925
      Patch description: "WLS PATCH SET UPDATE 14.1.1.0.210930"
         Created on 30 Sep 2021, 15:53:34 hrs PST8PDT
         Bugs fixed:
           30965440, 31564423, 32235275, 32528774, 31765550, 31742292, 32371861
           30912052, 31353368, 31950565, 31525147, 32868847, 25900775, 31770512
           31401659, 32544020, 31975788, 31510290, 32651810, 31918617, 32647611
           32054481, 33034990, 32373306, 32503912, 30285053, 31287540, 31671559
           32847474, 31332368, 31199699, 32408938, 32312961, 30284059, 32789767
           31316252, 31567049, 32068710, 31232471, 31475287, 31922313, 32248716
           33166329, 32875528, 32097062, 31816475, 32235872, 31247235, 33207639
           33152312, 33114718, 32883876, 31913015, 31995447, 32953480, 31047981
           32244262, 31943068, 30885114, 33245345, 31332264, 32077936, 32959192
           31583896, 31088577, 31498405, 32301793, 30838007, 31483821, 33063225
           33141458, 33171421, 30885128, 32214441, 29449188, 32976692, 31157988
           32519960, 31765567, 31142740, 30964331, 32226530, 31539237, 31492196
           30245934, 32832099, 32472196, 32228228, 32069620, 32697451, 32520971
           31011293, 31526201, 32064362, 32133880, 31441174, 30652362, 32950042
           32307656, 32639821, 32415913, 32893667, 31234573, 32108759, 33164116
           31113242, 31234666, 32593893, 31657139, 32920991, 32099344, 31160218
           30927469, 32497814, 30961904, 32962304, 31184158, 33170754, 32425607
           31380363
      
      Patch 33286174 : applied on Wed Nov 24 06:52:09 GMT 2021
      Unique Patch ID: 24406033
      Patch description: "Bundle patch for Oracle Coherence Version 14.1.1.0.7"
         Created on 21 Sep 2021, 12:11:28 hrs PST8PDT
         Bugs fixed:
           31201347, 31214284, 31806281, 31944953, 32124447, 32341371, 32581868
           32816973, 32822629, 32503887, 32421840, 32973306, 33286174
      -----------------------------------------------------------------------
      
    • rollback -id PatchNumber

      This command removes the specified patch from the Oracle_home directory, where PatchNumber is the patch number.

      You can find the patch number by using the lsinventory command. For example, you would use the command rollback -id 24406033 to roll back the patch shown in the following sample lsinventory output:

      ----------------------------------------------------------------------
      Interim patches (1) :
      
      Patch 33286174 : applied on Wed Nov 24 06:52:09 GMT 2021
      Unique Patch ID: 24406033
      Patch description: "Bundle patch for Oracle Coherence Version 14.1.1.0.7"
         Created on 21 Sep 2021, 12:11:28 hrs PST8PDT
         Bugs fixed:
           31201347, 31214284, 31806281, 31944953, 32124447, 32341371, 32581868
           32816973, 32822629, 32503887, 32421840, 32973306, 33286174
      -----------------------------------------------------------------------
      

For a full list of the OPatch commands and their descriptions, see "Common OPatch Commands When Patching an Oracle Fusion Middleware Oracle home" in Oracle Fusion Middleware Patching with OPatch.