为 Oracle Grid Infrastructure 主目录打补丁和切换
为 Oracle GoldenGate Maximum Availability Hub 堆栈的主集群和备用集群完成以下步骤。
只能使用 switchGridHome 命令在同一发行版的不同 RU 之间切换。
-
将要从 My Oracle Support 应用的 Oracle AI Database 发行版更新 (RU) 下载到 node1 的
/tmp目录中。 -
以 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 主目录路径不同。
-
作为集群 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 . -
使用
-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] -
以
root用户身份在群集的 node1 上运行以下脚本:$ /u01/app/<version-number>/grid/root.sh然后,在 node2 上运行脚本。
-
验证打补丁是否已完成。
$ 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]. -
验证所有 CRS 进程是否都在从新的网格主目录运行。
$ 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 -
在群集的两个节点上启用并重新启动
iptables。$ systemctl enable iptables $ systemctl restart iptables -
如果打补丁失败,请执行以下步骤来回退补丁程序:
-
以
root用户身份运行预打补丁脚本。# /u01/app/<version-number>/grid/crs/install/rootcrs.sh -prepatch -dstcrshome Old_GI_Home -rollback -
以
root用户身份运行后补丁程序脚本。# /u01/app/<version-number>/grid/crs/install/rootcrs.sh -postpatch -dstcrshome Old_GI_Home -rollback
-
-
如果已成功切换到所有节点上的新网格主目录并希望切换回旧网格主目录,请执行以下步骤:
-
以
root用户身份解锁旧网格主目录。# Old_GI_Home/crs/install/rootcrs.sh -unlock -crshome Old_GI_Home -
以
grid用户身份,从旧网格主目录运行switchGridHome。$ Old_GI_Home/gridSetup.sh -silent -switchGridHome [-zeroDowntimeGIPatching] [-skipDriverUpdate]
-