故障排查14 分钟阅读
避坑指南|Oracle RAC 补丁安装踩坑实录,你中招几个?
大家好,这里是公众号 DBA学习之路,分享一些学习数据库路上的知识和经验。 @TOC目录 上篇文章 《Oracle RAC 触发 BUG,crsd 无限重启!》https://www.modb.pro/db/190400
2025年3月26日阅读—点赞—收藏—
oraclerac
在知识库中专注阅读,并随时返回相关工具与课程
大家好,这里是公众号 DBA学习之路,分享一些学习数据库路上的知识和经验。 @TOC目录 上篇文章 《Oracle RAC 触发 BUG,crsd 无限重启!》https://www.modb.pro/db/190400
大家好,这里是公众号 DBA学习之路,分享一些学习数据库路上的知识和经验。

本章目标:掌握本章核心知识点 前置要求:完成前序章节学习 预计时长:60 分钟
上篇文章 《Oracle RAC 触发 BUG,crsd 无限重启!》 中提到通过安装补丁 Patch 34762026 解决集群故障,但由于篇幅限制未详细展开补丁安装过程。
不少读者留言咨询具体操作细节,恰巧我在实际安装过程中也踩了不少“坑”:从环境预检的隐藏雷区到 OPatch 的版本陷阱,补丁依赖的连环套问题。
本文将结合实战经验,手把手拆解补丁安装全流程,顺便给大家避避坑(点个关注不迷路~),希望大家后续遇到同样问题可以顺利解决!
下载 BUG 所需补丁 Patch 24396050: LNX64-12.2-CRS: CRSD.BIN FAILED SEVERAL TIMES WITH ERROR CRS-1019

本文所需补丁我已经整理上传百度网盘,如有需要可关注公众号:DBA学习之路,公众号聊天框发送 24396050 获取对应补丁。

安装补丁第一步都建议大家查看补丁自带的 README 文件,其中会详细的告知你补丁安装的步骤以及前置准备等信息。
通过查看补丁 README:You must use the OPatch utility version 12.2.0.1.5 or later to apply this patch. ,要求 OPatch 版本要大于 12.2.0.1.5,这里一上来我就踩了个坑。
检查当前 OPatch 补丁是否符合要求:
1[grid@lucifer01 ~]$ cd $ORACLE_HOME/OPatch/2[grid@lucifer01 OPatch]$ ./opatch version3OPatch Version: 12.2.0.1.645OPatch succeeded.一看这里符合要求,我就没管了,然后我就踩坑了。
如果不更新 OPatch,直接应用补丁,报错内容如下:
1Opatchauto in 12.2 requires the creation of a wallet file with password for owner of grid software on all nodes.23Failure of specifying wallet would result into the below errors :45OPATCHAUTO-68021: Missing required argument(s).6OPATCHAUTO-68021: The following argument(s) are required: [-wallet]7OPATCHAUTO-68021: Provide the required argument(s).只有更新 OPatch 到 12.2.0.1.8 之后才不会需要 -wallet 选项,否则强制需要,可参考 MOS 文档:
Creation of opatchauto wallet in 12.2 in 12.2.0.1.8 (Doc ID 2270185.1)
经验一:不管 README 要求最低版本是多少,都建议将 OPatch 都升级到最新版本。
下载最新的 OPatch 包并更新,所有节点均需执行:
1## 需要使用 root 用户先授予补丁包 grid 用户权限2[root@lucifer01:/root]# chown -R grid:oinstall /soft/3## grid 用户执行4[grid@lucifer02:/home/grid]$ unzip -qo /soft/p6880880_122010_Linux-x86-64.zip -d $ORACLE_HOME5[grid@lucifer02:/home/grid]$ unzip -qo /soft/p6880880_122010_Linux-x86-64.zip -d $ORACLE_HOME更新后查看 opatch 版本:
1[grid@lucifer01:/home/grid]$ opatch version2OPatch Version: 12.2.0.1.4534OPatch succeeded.56[grid@lucifer02:/home/grid]$ opatch version7OPatch Version: 12.2.0.1.4589OPatch succeeded.确保 OPatch 已更新到最新版本,否则会遇到坑一。
下载后的补丁包上传到主机目录下,解压到指定目录:
1## root 执行2[root@lucifer01:/root]# unzip -q /soft/p24396050_122010_Linux-x86-64.zip -d /soft/3[root@lucifer01:/root]# chown -R grid:oinstall /soft/解压后建议授权为 grid 用户,避免后续操作权限问题。
grid 补丁建议使用 opatchauto 进行安装,然而 opatchauto 需要使用 root 用户执行,所以需要提前指定环境变量:
1## root 执行2[root@lucifer01:/root]# export GI_HOME=/u01/app/12.2.0/grid建议在正式安装前执行检查(所有节点都需执行),避免安装过程中出现问题,这一步又遇到两个坑,先坑为敬。
这个坑是因为在 /root 目录下执行 opatchauto 命令报错:
1[root@lucifer01:/root]# $GI_HOME/OPatch/opatchauto apply /soft/24396050 -oh $GI_HOME -analyze23Invalid current directory. Please run opatchauto from other than '/root' and '/' directory.4And check if the home owner user has write permission set for the current directory.5opatchauto returns with error code = 2建议在补丁目录下执行:
1[root@lucifer01:/root]# cd /soft/243960502[root@lucifer02:/soft/24396050]# $GI_HOME/OPatch/opatchauto apply /soft/24396050 -oh $GI_HOME -analyze经验二:执行补丁安装时,建议在补丁解压所在目录执行。
因为数据库主机系统版本是 rhel8.10,而 Oracle 12CR2 刚发布时不支持 rhel8.10,所以打这个补丁需要设置 CV_ASSUME_DISTID=OEL7.8,否则会执行报错:
1Shared home /u01/app/12.2.0/grid can only be patched in nonrolling mode.23OPATCHAUTO-72030: Execution mode invalid.4OPATCHAUTO-72030: Cannot execute in rolling mode, as CRS home is shared.5OPATCHAUTO-72030: Execute in non-rolling mode.设置之后即可执行成功,具体可参考 MOS 文档:
Prepare for and Top Issues of RU Patching via "opatchauto apply" and "opatchauto resume" in Different User Environment (Doc ID 2840546.1)
- Issue #7 OPATCHAUTO-72030: Cannot execute in rolling mode, as CRS home is shared
解决完以上两个坑之后,顺利执行预检查过程:
1## 节点一2[root@lucifer01:/soft/24396050]# export CV_ASSUME_DISTID=OEL7.83[root@lucifer01:/soft/24396050]# $GI_HOME/OPatch/opatchauto apply /soft/24396050 -oh $GI_HOME -analyze45OPatchauto session is initiated at Tue Mar 25 14:32:12 202567System initialization log file is /u01/app/12.2.0/grid/cfgtoollogs/opatchautodb/systemconfig2025-03-25_02-32-14PM.log.89Session log file is /u01/app/12.2.0/grid/cfgtoollogs/opatchauto/opatchauto2025-03-25_02-32-21PM.log10The id for this session is PPD41112Executing OPatch prereq operations to verify patch applicability on home /u01/app/12.2.0/grid13Patch applicability verified successfully on home /u01/app/12.2.0/grid1415Executing patch validation checks on home /u01/app/12.2.0/grid16Patch validation checks successfully completed on home /u01/app/12.2.0/grid1718OPatchAuto successful.1920--------------------------------Summary--------------------------------2122Analysis for applying patches has completed successfully:2324Host:lucifer0125CRS Home:/u01/app/12.2.0/grid26Version:12.2.0.1.02728==Following patches were SUCCESSFULLY analyzed to be applied:2930Patch: /soft/24396050/2439605031Log: /u01/app/12.2.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2025-03-25_14-32-25PM_1.log3233OPatchauto session completed at Tue Mar 25 14:32:28 202534Time taken to complete the session 0 minute, 16 seconds3536## 节点二37[root@lucifer02:/soft/24396050]# export CV_ASSUME_DISTID=OEL7.838[root@lucifer02:/soft/24396050]# $GI_HOME/OPatch/opatchauto apply /soft/24396050 -oh $GI_HOME -analyze3940OPatchauto session is initiated at Tue Mar 25 14:42:25 20254142System initialization log file is /u01/app/12.2.0/grid/cfgtoollogs/opatchautodb/systemconfig2025-03-25_02-42-26PM.log.4344Session log file is /u01/app/12.2.0/grid/cfgtoollogs/opatchauto/opatchauto2025-03-25_02-42-34PM.log45The id for this session is HPWC4647Executing OPatch prereq operations to verify patch applicability on home /u01/app/12.2.0/grid48Patch applicability verified successfully on home /u01/app/12.2.0/grid4950Executing patch validation checks on home /u01/app/12.2.0/grid51Patch validation checks successfully completed on home /u01/app/12.2.0/grid5253OPatchAuto successful.5455--------------------------------Summary--------------------------------5657Analysis for applying patches has completed successfully:5859Host:lucifer0260CRS Home:/u01/app/12.2.0/grid61Version:12.2.0.1.06263==Following patches were SUCCESSFULLY analyzed to be applied:6465Patch: /soft/24396050/2439605066Log: /u01/app/12.2.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2025-03-25_14-42-39PM_1.log6768OPatchauto session completed at Tue Mar 25 14:42:41 202569Time taken to complete the session 0 minute, 17 seconds检查没有问题,正式进行补丁安装。
安装补丁时需要 root 用户执行,所以需要提前指定环境变量:
1## root 执行2[root@lucifer01:/root]# export GI_HOME=/u01/app/12.2.0/grid然后执行安装补丁:
1## 节点一2[root@lucifer01:/soft/24396050]# export CV_ASSUME_DISTID=OEL7.83[root@lucifer01:/soft/24396050]# $GI_HOME/OPatch/opatchauto apply /soft/24396050 -oh $GI_HOME45OPatchauto session is initiated at Tue Mar 25 14:35:47 202567System initialization log file is /u01/app/12.2.0/grid/cfgtoollogs/opatchautodb/systemconfig2025-03-25_02-35-49PM.log.89Session log file is /u01/app/12.2.0/grid/cfgtoollogs/opatchauto/opatchauto2025-03-25_02-35-56PM.log10The id for this session is 1V5S1112Executing OPatch prereq operations to verify patch applicability on home /u01/app/12.2.0/grid13Patch applicability verified successfully on home /u01/app/12.2.0/grid1415Executing patch validation checks on home /u01/app/12.2.0/grid16Patch validation checks successfully completed on home /u01/app/12.2.0/grid1718Performing prepatch operations on CRS - bringing down CRS service on home /u01/app/12.2.0/grid19Prepatch operation log file location: /u01/app/grid/crsdata/lucifer01/crsconfig/crspatch_lucifer01_2025-03-25_02-36-05PM.log20CRS service brought down successfully on home /u01/app/12.2.0/grid2122Start applying binary patch on home /u01/app/12.2.0/grid23Binary patch applied successfully on home /u01/app/12.2.0/grid2425Running rootadd_rdbms.sh on home /u01/app/12.2.0/grid26Successfully executed rootadd_rdbms.sh on home /u01/app/12.2.0/grid2728Performing postpatch operations on CRS - starting CRS service on home /u01/app/12.2.0/grid29Postpatch operation log file location: /u01/app/grid/crsdata/lucifer01/crsconfig/crspatch_lucifer01_2025-03-25_02-38-35PM.log30CRS service started successfully on home /u01/app/12.2.0/grid3132OPatchAuto successful.3334--------------------------------Summary--------------------------------3536Patching is completed successfully. Please find the summary as follows:3738Host:lucifer0139CRS Home:/u01/app/12.2.0/grid40Version:12.2.0.1.041Summary:4243==Following patches were SUCCESSFULLY applied:4445Patch: /soft/24396050/2439605046Log: /u01/app/12.2.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2025-03-25_14-38-02PM_1.log4748OPatchauto session completed at Tue Mar 25 14:40:57 202549Time taken to complete the session 5 minutes, 10 seconds5051## 节点二52[root@lucifer02:/soft/24396050]# export CV_ASSUME_DISTID=OEL7.853[root@lucifer02:/soft/24396050]# $GI_HOME/OPatch/opatchauto apply /soft/24396050 -oh $GI_HOME5455OPatchauto session is initiated at Tue Mar 25 14:43:47 20255657System initialization log file is /u01/app/12.2.0/grid/cfgtoollogs/opatchautodb/systemconfig2025-03-25_02-43-49PM.log.5859Session log file is /u01/app/12.2.0/grid/cfgtoollogs/opatchauto/opatchauto2025-03-25_02-43-56PM.log60The id for this session is PWUR6162Executing OPatch prereq operations to verify patch applicability on home /u01/app/12.2.0/grid63Patch applicability verified successfully on home /u01/app/12.2.0/grid6465Executing patch validation checks on home /u01/app/12.2.0/grid66Patch validation checks successfully completed on home /u01/app/12.2.0/grid6768Performing prepatch operations on CRS - bringing down CRS service on home /u01/app/12.2.0/grid69Prepatch operation log file location: /u01/app/grid/crsdata/lucifer02/crsconfig/crspatch_lucifer02_2025-03-25_02-44-04PM.log70CRS service brought down successfully on home /u01/app/12.2.0/grid7172Start applying binary patch on home /u01/app/12.2.0/grid73Binary patch applied successfully on home /u01/app/12.2.0/grid7475Running rootadd_rdbms.sh on home /u01/app/12.2.0/grid76Successfully executed rootadd_rdbms.sh on home /u01/app/12.2.0/grid7778Performing postpatch operations on CRS - starting CRS service on home /u01/app/12.2.0/grid79Postpatch operation log file location: /u01/app/grid/crsdata/lucifer02/crsconfig/crspatch_lucifer02_2025-03-25_02-45-49PM.log80CRS service started successfully on home /u01/app/12.2.0/grid8182OPatchAuto successful.8384--------------------------------Summary--------------------------------8586Patching is completed successfully. Please find the summary as follows:8788Host:lucifer0289CRS Home:/u01/app/12.2.0/grid90Version:12.2.0.1.091Summary:9293==Following patches were SUCCESSFULLY applied:9495Patch: /soft/24396050/2439605096Log: /u01/app/12.2.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2025-03-25_14-45-18PM_1.log9798OPatchauto session completed at Tue Mar 25 14:47:23 202599Time taken to complete the session 3 minutes, 36 seconds执行完成后查看补丁是否安装完成:
1[grid@lucifer01:/home/grid]$ opatch lspatches224396050;OCW Interim patch for 2439605034OPatch succeeded.56[grid@lucifer02:/home/grid]$ opatch lspatches724396050;OCW Interim patch for 2439605089OPatch succeeded.安装补丁后重启系统验证集群恢复正常。
避坑重点:90% 的安装失败源于准备工作不充分!你在打补丁时还遇到过哪些“神坑”?欢迎评论区分享!
