修正並切換 Oracle Grid Infrastructure 本位目錄

針對 Oracle GoldenGate 最大可用性中心堆疊的主要與待命叢集,完成下列步驟。

您只能使用 switchGridHome 指令在相同發行版本的不同 RU 之間切換。

  1. 將您要從 My Oracle Support 套用的 Oracle AI Database 版本更新 (RU) 下載至 node1 的 /tmp 目錄中。

  2. 以 node1 和 node2 的 root 使用者身分,建立新的 Oracle Grid Infrastructure 本位目錄並停用 iptables。請確定將 <version-number> 取代為適當的 RU 版本號碼。

    $ mkdir -p /u01/app/<version-number>/grid
    $ chown grid:oinstall /u01/app/<version-number>/grid
    $ systemctl stop iptables
    $ systemctl disable iptables

    注意:新的 Oracle Grid Infrastructure 本位目錄路徑必須與目前的 Oracle Grid Infrastructure 本位目錄路徑不同。

  3. 以叢集 node1 上的 grid 使用者身分,下載 Oracle Grid Infrastructure 映像檔,然後將檔案擷取至新的 Oracle Grid Infrastructure 本位目錄。將方格設定回應檔從現有的 Oracle Grid Infrastructure 本位目錄路徑複製到新的本位目錄路徑。請確定將 <version-number> 取代為適當的 RU 版本號碼。

    $ cd /u01/app/<version-number>/grid
    $ unzip -q download_location/grid.zip
    $ cp Old_GI_Home/gridsetup.rsp  .
  4. 使用 -switchGridHome 旗標在 node1 上啟動 Oracle Grid Infrastructure 安裝程式,在安裝後切換至修正的 Oracle Grid Infrastructure 本位目錄,並在安裝期間使用選擇性的 -applyRU 旗標套用版本更新 (RU)。請確定將 <version-number> 取代為適當的 RU 版本號碼。

    $ /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. 以 root 使用者身分,在叢集的 node1 上執行下列命令檔:

    $ /u01/app/<version-number>/grid/root.sh

    接著,在 node2 執行命令檔。

  6. 確認修正已完成。

    $ 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. 確認所有 CRS 處理作業都從新的 Grid Home 執行。

    $ ps -ef | grep d\.bin

    回應應傳回下列項目:

    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. 在叢集的兩個節點上啟用並重新啟動 iptables。

    $ systemctl enable iptables
    $ systemctl restart iptables
  9. 如果修正失敗,請執行下列步驟來倒回修正程式:

    1. 以 root 使用者身分,執行前置修正命令檔。

      # /u01/app/<version-number>/grid/crs/install/rootcrs.sh -prepatch -dstcrshome Old_GI_Home -rollback
    2. 以 root 使用者身分執行後續修正命令檔。

      # /u01/app/<version-number>/grid/crs/install/rootcrs.sh -postpatch -dstcrshome Old_GI_Home -rollback
  10. 如果您已順利切換至所有節點上的新 Grid 本位目錄,並想要切換回舊的 Grid 本位目錄,請執行下列步驟:

    1. 以 root 使用者身分解除鎖定舊的 Grid 本位目錄。

      # Old_GI_Home/crs/install/rootcrs.sh -unlock -crshome Old_GI_Home
    2. 以 grid 使用者身分,從舊的 Grid 本位目錄執行 switchGridHome。

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