Applying Patches to Oracle Grid Infrastructure

Review these scenarios for applying patches to Oracle Grid Infrastructure in different stages of installation or upgrade.

For clusters that use FIPS 140.3, review Patching, Upgrading, and Downgrading Oracle Grid Infrastructure with FIPS 140.3 for the all-nodes fix requirement and rollback compatibility. For the rolling procedure to enable FIPS 140.3 after patching is complete, see Enabling FIPS 140.3 for Oracle Grid Infrastructure.

Applying Patches Using Zero-Downtime Oracle Grid Infrastructure Patching

Apply zero-downtime patches to Oracle Grid Infrastructure while keeping Oracle RAC database instances available.

Note:

Oracle recommends using Oracle Fleet Patching and Provisioning (Oracle FPP) Local Mode for patching Oracle Grid Infrastructure. For more information, see Patching Oracle Grid Infrastructure Using Oracle FPP Local Mode.

Use the switchGridHome command to switch from the current Oracle Grid Infrastructure home to the patched Oracle Grid Infrastructure home. You can use the switchGridHome command only to switch between different Release Updates (RUs) of the same release, for example, from Oracle Grid Infrastructure 23.3 to 23.4.

Note:

You can use zero-downtime patching only for out-of-place patching of Oracle Grid Infrastructure with Oracle RAC or Oracle RAC One Node databases version 19c or later. If your Oracle RAC or Oracle RAC One Node database is older than 19c, then the database instances stop during zero-downtime patching.

  1. Download the Release Updates (RUs) you want to apply from My Oracle Support.
  2. As the grid user, download the Oracle Grid Infrastructure image files and extract the files into a new Oracle Grid Infrastructure home directory.

    $ mkdir -p /u01/app/23.7.0/grid
    $ chown grid:oinstall /u01/app/23.7.0/grid 
    $ cd /u01/app/23.7.0/grid 
    $ unzip -q download_location/grid.zip

    Note:

    The new Oracle Grid Infrastructure home path must differ from the current Oracle Grid Infrastructure home path.

  3. Download and install the latest OPatch version in the new Oracle Grid Infrastructure home.
  4. Register the new Oracle Grid Infrastructure home in the central inventory.
    ./gridSetup.sh -setupHomeAs source_Grid_home -clusterNodes comma_separated_list_of_nodes

    This step also performs a software-only installation in the new Grid home on all specified cluster nodes.

  5. Switch to the patched Oracle Grid Infrastructure home using one of the following methods:
    • Start the Oracle Grid Infrastructure installer in silent mode, with the -switchGridHome flag, from the patched home.

      $ /u01/app/23.7.0/grid/gridSetup.sh -silent -switchGridHome [-zeroDowntimeGIPatching [-skipDriverUpdate]] 
      [-applyOneOffs comma_seperated_list_of_patch_directory_locations]
    • Start the Oracle Grid Infrastructure installer in interactive mode from the patched home.

      $ /u01/app/23.7.0/grid/gridSetup.sh

      Then perform the following steps:

      1. Select the Patch Oracle Grid Infrastructure option in the Configuration Option window.
      2. Select the Use Zero Downtime GI patching option.
      3. Select Skip updating ACFS drivers if the patch that you are installing contains operating system driver updates and you want to skip them.
      4. Enter the values required for your environment when prompted by the installation screens.

    All Oracle Grid Infrastructure services run from the new Grid home after patching completes.

  6. Verify that patching completed successfully.

    $ /u01/app/23.7.0/grid/crsctl query crs activeversion -f
    Oracle Clusterware active version on the cluster is [23.0.0.0.0]. The cluster upgrade state is [NORMAL]. 
    The cluster active patch level is 456789126.
  7. If patching fails, then perform the following rollback steps:

    1. As the root user, run the prepatch script.

      # /u01/app/23.7.0/grid/crs/install/rootcrs.sh -prepatch -dstcrshome Old_GI_Home 
      -nodriverupdate -transparent -rollback
    2. As the root user, run the postpatch script.

      # /u01/app/23.7.0/grid/crs/install/rootcrs.sh -postpatch -dstcrshome Old_GI_Home 
      -nodriverupdate -transparent -rollback
  8. If you want to switch back to the old Grid home after successfully switching to the new Grid home on all nodes:

    1. As the root user, unlock the old Grid home on all cluster nodes.

      # Old_GI_Home/crs/install/rootcrs.sh -unlock -crshome Old_GI_Home
    2. As the grid user, run switchGridHome from the old Grid home.

      $ Old_GI_Home/gridSetup.sh -silent -switchGridHome [-zeroDowntimeGIPatching [-skipDriverUpdate]]

Related Topics

Applying Patches During an Oracle Grid Infrastructure Installation or Upgrade

You can download and apply Release Updates (RUs) and one-off patches during an Oracle Grid Infrastructure installation or upgrade.

  1. Download the patches you want to apply from My Oracle Support:

    https://support.oracle.com

  2. Select the Patches and Updates tab to locate the patch.

    Oracle recommends that you select Recommended Patch Advisor, and enter the product group, release, and platform for your software.

  3. Move the patches to an accessible directory like /tmp.
  4. Change to the Oracle Grid Infrastructure home directory:

    $ cd /u01/app/23.0.0/grid
  5. Apply Release Updates (RUs) and any one-off patches during the installation or upgrade process:

    $ ./gridSetup.sh -applyRU /tmp/patch_ID -applyOneOffs /tmp/patch_ID

    Note:

    You can apply RUs and one-off patches separately or together in the same command.

  6. Complete the remaining steps in the Oracle Grid Infrastructure configuration wizard to complete the installation or upgrade.

Applying Patches After an Oracle Grid Infrastructure Installation or Upgrade

You can apply patches to Oracle Grid Infrastructure deployment in rolling mode after a successful or a failed upgrade. This mode is similar to the "Rolling Upgrade" mode in terms of the Oracle ASM operations allowed in this quiesce state.

  1. Download patches you want to apply from My Oracle Support:

    https://support.oracle.com

  2. Review the patch documentation for the patch you want to apply, and complete all required steps before starting the patch upgrade.
  3. Follow the instructions in the patch documentation to apply the patch on the first node.
    # Grid_home/OPatch/opatchauto apply /tmp/patch_ID

    Wait for the patching to finish on the first node before patching other cluster nodes.

    Note:

    The use of OPatch and OPatchAuto for out-of-place patching continues to be deprecated.

    For patching in Oracle AI Database 26ai, Oracle recommends that you use out-of-place patching using Gold images to apply quarterly release updates (RUs). This deprecation does not affect in-place patching. If you want to perform in-place patching, then OPatch and OPatchAuto continue to be available for this purpose. The Oracle AI Database 26ai Free release is not supported for patching with RUs.

  4. Apply the patch on all other cluster nodes, one at a time.

    # Grid_home/OPatch/opatchauto apply patch_directory_location/patch_ID

    Note:

    You can also use Oracle FPP Local Mode to automate the patching process.

Related Topics

Applying Patches when Oracle Clusterware Fails to Start

If the Oracle Clusterware stack does not start because of any error, then you can patch Oracle Grid Infrastructure using the OPatch utility.

  1. Download patches you want to apply from My Oracle Support:

    https://support.oracle.com

    Select the Patches and Updates tab to locate the patch.

    Oracle recommends that you select Recommended Patch Advisor, and enter the product group, release, and platform for your software. My Oracle Support provides you with a list of the most recent Release Updates (RUs) and Release Update Revisions (RURs).

    Place the patches in an accessible directory, such as /tmp.

  2. Review the patch documentation for the patch you want to apply, and complete all required steps before starting the patch upgrade.
  3. As the root user, stop the Oracle Clusterware stack on the first node.

    # $ORACLE_HOME/bin/crsctl stop crs -f
  4. Unlock the Oracle Grid Infrastructure home on the first node.

    # $ORACLE_HOME/crs/install/rootcrs.sh -unlock
  5. As the grid user, follow the instructions in the patch documentation to apply the patch on the first node.
    $ $ORACLE_HOME/OPatch/opatch apply patch_directory_location/patch_ID

    Wait for the patching to finish on the first node before patching other cluster nodes.

  6. As the root user, lock the Oracle Grid Infrastructure home on the first node.

    # $ORACLE_HOME/rdbms/install/rootadd_rdbms.sh
    # $ORACLE_HOME/crs/install/rootcrs.sh -lock
  7. Update Oracle Local Registry (OLR) to the patch level on the first node.

    # $ORACLE_HOME/bin/clscfg -localpatch
  8. Check if Oracle Clusterware is in the ROLLING PATCH mode.

    $ crsctl query crs activeversion -f
    Oracle Clusterware active version on the cluster is [23.0.0.0.0]. 
    The cluster upgrade state is [NORMAL]. The cluster active patch level is [0].

    If Oracle Clusterware is not in the ROLLING PATCH mode, then set Oracle Clusterware in ROLLING PATCH mode from a node where Oracle Clusterware is online.

    $ crsctl start rollingpatch
  9. Start the Oracle Clusterware stack on the first node.

    # $ORACLE_HOME/bin/crsctl start crs
  10. Update Oracle Cluster Registry (OCR) to the patch level on the first node.

    # $ORACLE_HOME/bin/clscfg -patch
  11. Repeat steps 3 through 10 on all other cluster nodes.

    You can patch all other cluster nodes in parallel.

  12. Transition Oracle Clusterware out of the ROLLING PATCH mode.

    $ crsctl stop rollingpatch