Patch and switch Oracle Grid Infrastructure Homes

Complete the following steps for both the primary and standby clusters of your Oracle GoldenGate Maximum Availability Hub stack.

You can use the switchGridHome command only to switch between different RUs of the same release.
  1. Download the Oracle Database Release Update (RU) that you want to apply from My Oracle Support into the /tmp directory of node1.
  2. As the root user on both node1 and node2, create a new Oracle Grid Infrastructure home directory and disable iptables. Ensure that you replace <version-number> with the appropriate RU version number.
    $ mkdir -p /u01/app/<version-number>/grid
    $ chown grid:oinstall /u01/app/<version-number>/grid
    $ systemctl stop iptables
    $ systemctl disable iptables

    Note:

    The new Oracle Grid Infrastructure home path must be different from the current Oracle Grid Infrastructure home path.
  3. As the grid user on node1 of the cluster, download the Oracle Grid Infrastructure images files and extract the files to the new Oracle Grid Infrastructure home directory. Copy the grid setup response file from the existing Oracle Grid Infrastructure home path to the new home path. Ensure that you replace <version-number> with the appropriate RU version number.
    
    $ cd /u01/app/<version-number>/grid
    $ unzip -q download_location/grid.zip
    $ cp Old_GI_Home/gridsetup.rsp  .
  4. Start the Oracle Grid Infrastructure installer on node1 with the -switchGridHome flag to switch to the patched Oracle Grid Infrastructure home after the installation and the optional -applyRU flag to apply Release Updates (RUs) during the installation. Ensure that you replace <version-number> with the appropriate RU version number.
    $ /u01/app/<version-number>/grid/gridSetup.sh -responseFile /u01/app/<version-number>/grid/gridsetup.rsp -switchGridHome [-applyRU patch_directory_location] 
    [-applyOneOffs comma_seperated_list_of_patch_directory_locations]
  5. As the root user, run the following script on node1 of the cluster:
    $ /u01/app/<version-number>/grid/root.sh

    Then, run the script on node2.

  6. Verify that the patching has completed.
    $ crsctl query crs activeversion -f
    Oracle Clusterware active version on the cluster is [19.0.0.0.0]. The cluster upgrade state is [NORMAL]. 
    The cluster active patch level is [patch_level].
  7. Verify that all CRS processes are running from the new Grid Home.
    $ ps -ef | grep d\\.bin

    The response should return the following:

    grid      6322     1  0 19:16 ?        00:00:00 /u01/app/<version-number>/grid/bin/acfsrepl_dupd.bin /mnt/acfs_gg
    root     28946     1  0 19:12 ?        00:00:05 /u01/app/<version-number>/grid/bin/ohasd.bin reboot _ORA_BLOCKING_STACK_LOCALE=AMERICAN_AMERICA.AL32UTF8
    grid     29169     1  0 19:12 ?        00:00:00 /u01/app/<version-number>/grid/bin/mdnsd.bin
    grid     29170     1  0 19:12 ?        00:00:02 /u01/app/<version-number>/grid/bin/evmd.bin
    grid     29209     1  0 19:12 ?        00:00:00 /u01/app/<version-number>/grid/bin/gpnpd.bin
    grid     29274     1  0 19:12 ?        00:00:02 /u01/app/<version-number>/grid/bin/gipcd.bin
    root     29310     1  0 19:12 ?        00:00:05 /u01/app/<version-number>/grid/bin/osysmond.bin
    grid     29397     1  0 19:12 ?        00:00:05 /u01/app/<version-number>/grid/bin/ocssd.bin  -S 1
    root     29595     1  0 19:12 ?        00:00:02 /u01/app/<version-number>/grid/bin/octssd.bin reboot
    root     29629     1  1 19:12 ?        00:00:11 /u01/app/<version-number>/grid/bin/crsd.bin reboot
  8. Enable and restart iptables on both nodes of the cluster.
    $ systemctl enable iptables
    $ systemctl restart iptables
  9. If the patching fails, then perform the following steps to rollback the patch:
    1. As the root user, run the prepatch script.
      # /u01/app/<version-number>/grid/crs/install/rootcrs.sh -prepatch -dstcrshome Old_GI_Home -rollback
    2. As the root user, run the postpatch script.
      # /u01/app/<version-number>/grid/crs/install/rootcrs.sh -postpatch -dstcrshome Old_GI_Home -rollback
  10. If you have successfully switched to the new Grid home on all nodes and want to switch back to the old Grid home, then perform the following steps:
    1. As the root user, unlock the old Grid home.
      # 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]