Oracle RAC 第二节点打补丁报错 oui-patch.xml (Permission denied)
##GRID
第二节点打补丁报错 oui-patch.xml (Permission denied)
#<GRID_HOME>/OPatch/opatchauto apply <unzipped location of patch>
OPatchauto session is initiated at Tue May 31 02:21:42 2019
System initialization log file is <GRID_HOME>/cfgtoollogs/opatchautodb/systemconfig2019-05-31_02-21-44AM.log.
Session log file is <GRID_HOME>/cfgtoollogs/opatchauto/opatchauto2019-05-31_02-21-44AM.log
.
.
.
Patch: <unzipped location of patch>
Log: <GRID_HOME>/cfgtoollogs/opatchauto/core/opatch/opatch2019-05-31_02-22-44AM_1.log
Reason: Failed during Patching: oracle.opatch.opatchsdk.OPatchException: ApplySession failed in system modification phase... 'ApplySession::apply failed: java.io.IOException: oracle.sysman.oui.patch.PatchException: java.io.FileNotFoundException: <Inventory_location>/ContentsXML/oui-patch.xml (Permission denied)'
After fixing the cause of failure Run opatchauto resume
##发现权限不对,是RAC的一个bug,官方说是 由于二节点未使用oui进程安装的,所以未生成这个文件。
During 19.x Grid Infrastructure (GI) installation, the file 'oui-patch.xml' will be created under the central inventory directory on the OUI node (node where gridSetup.sh was invoked) but not on the remote nodes.
-bash-4.4# hostname;date;ls -ltr $oraInventory/ContentsXML/
<NODE 1>
Fri May 31 02:31:36 PDT 2019
total 16
-rw-rw---- 1 grid oinstall 570 May 31 00:40 inventory.xml
-rw-rw---- 1 grid oinstall 174 May 31 00:40 oui-patch.xml ---> Owned by grid 正常节点
-rw-rw---- 1 grid oinstall 292 May 31 00:43 libs.xml
-bash-4.4# hostname;date;ls -ltr $oraInventory/ContentsXML/
<NODE 2>
Fri May 31 02:30:46 PDT 2019
total 20
-rw-rw---- 1 grid oinstall 570 May 31 00:43 inventory.xml
-rw-r--r-- 1 oracle oinstall 174 May 31 02:21 oui-patch.xml ---> Owned by oracle -->这里应该是opatchauto执行时,先安装DB HOME的补丁导致使用Oracle用户生成了oui-patch.xml文件需要修改权限,或者从1节点拷贝
-rw-rw---- 1 grid oinstall 292 May 31 02:21 libs.xml
-rw-rw---- 1 grid oinstall 300 May 31 02:21 comps.xml
##官方给的解决方案是从1节点copy oui-patch.xml 文件过来,然后重新使用opatchauto resume开始安装补丁。
在我这里并不好使。
紧接着有如下的问题:
##然后系统报错:
[grid@rac02 ~]$ $ORACLE_HOME/OPatch/opatch lspatches
Inventory load failed... LsPatchesSession::loadAndPrintInstalledPatch()
LsPatchesSession failed: Unable to create patchObject
Possible causes are:
ORACLE_HOME/inventory/oneoffs/32545013 is corrupted. PatchObject constructor: Input file "/u01/app/19.3.0.0/grid/inventory/oneoffs/32545013/etc/config/actions" or "/u01/app/19.3.0.0/grid/inventory/oneoffs/32545013/etc/config/inventory" does not exist.
OPatch failed with error code 2
找32545013补丁找不到。
##我的解决方案
1.从好的节点拷贝这个补丁文件到问题节点
[grid@rac01 ~]$ cd /u01/app/19.3.0.0/grid/inventory/oneoffs/
[grid@rac01 oneoffs]$ ls -l
total 0
drwxr-x--- 4 grid oinstall 29 Apr 18 2019 29401763
drwxr-x--- 4 grid oinstall 29 Apr 18 2019 29517242
drwxr-x--- 4 grid oinstall 29 Apr 18 2019 29517247
drwxr-x--- 4 grid oinstall 29 Apr 18 2019 29585399
drwxr-xr-x 4 grid oinstall 29 Jul 3 09:49 32545013
drwxr-xr-x 4 grid oinstall 29 Jul 3 09:50 32576499
drwxr-xr-x 4 grid oinstall 29 Jul 3 09:52 32579761
drwxr-xr-x 4 grid oinstall 29 Jul 3 09:52 32584670
drwxr-xr-x 4 grid oinstall 29 Jul 3 09:53 32585572
[grid@rac01 oneoffs]$ tar -cvf 32545013.tar 32545013
32545013/
32545013/etc/
32545013/etc/config/
32545013/etc/config/inventory.xml
32545013/etc/config/actions.xml
32545013/jlib/
[grid@rac01 oneoffs]$ scp 32545013.tar rac02:$PWD
32545013.tar
[grid@rac01 ~]$ cd /u01/app/19.3.0.0/grid/inventory/oneoffs/
[grid@rac01 oneoffs]$ ls -l
total 0
drwxr-x--- 4 grid oinstall 29 Apr 18 2019 29401763
drwxr-x--- 4 grid oinstall 29 Apr 18 2019 29517242
drwxr-x--- 4 grid oinstall 29 Apr 18 2019 29517247
drwxr-x--- 4 grid oinstall 29 Apr 18 2019 29585399
drwxr-xr-x 4 grid oinstall 29 Jul 3 09:49 32545013
drwxr-xr-x 4 grid oinstall 29 Jul 3 09:50 32576499
drwxr-xr-x 4 grid oinstall 29 Jul 3 09:52 32579761
drwxr-xr-x 4 grid oinstall 29 Jul 3 09:52 32584670
drwxr-xr-x 4 grid oinstall 29 Jul 3 09:53 32585572
[grid@rac01 oneoffs]$ tar -cvf 32545013.tar 32545013
32545013/
32545013/etc/
32545013/etc/config/
32545013/etc/config/inventory.xml
32545013/etc/config/actions.xml
32545013/jlib/
[grid@rac01 oneoffs]$ scp 32545013.tar rac02:$PWD
32545013.tar
2.再次执行发现可以 使用opatch命令查询出来
[grid@rac02 oneoffs]$ $ORACLE_HOME/OPatch/opatch lspatches
32545013;Database Release Update : 19.11.0.0.210420 (32545013)
29585399;OCW RELEASE UPDATE 19.3.0.0.0 (29585399)
29517247;ACFS RELEASE UPDATE 19.3.0.0.0 (29517247)
29401763;TOMCAT RELEASE UPDATE 19.0.0.0.0 (29401763)
3.此时可以 使用opatchauto回滚补丁
root@rac02 oracle]# opatchauto rollback /soft/oracle/32545008 -oh /u01/app/19.3.0.0/grid
OPatchauto session is initiated at Sat Jul 3 12:09:00 2021
System initialization log file is /u01/app/19.3.0.0/grid/cfgtoollogs/opatchautodb/systemconfig2021-07-03_12-09-05PM.log.
浼..?ュ??.欢?.u01/app/19.3.0.0/grid/cfgtoollogs/opatchauto/opatchauto2021-07-03_12-09-11PM.log
姝や?璇.. ID 涓?NK5U
Executing OPatch prereq operations to verify patch applicability on home /u01/app/19.3.0.0/grid
Patch applicability verified successfully on home /u01/app/19.3.0.0/grid
Executing patch validation checks on home /u01/app/19.3.0.0/grid
Patch validation checks successfully completed on home /u01/app/19.3.0.0/grid
Checking shared status of home.....
Performing prepatch operations on CRS - bringing down CRS service on home /u01/app/19.3.0.0/grid
Prepatch operation log file location: /u01/app/grid/crsdata/rac02/crsconfig/crs_prepatch_rac02_2021-07-03_12-10-23AM.log
CRS service brought down successfully on home /u01/app/19.3.0.0/grid
Start rolling back binary patch on home /u01/app/19.3.0.0/grid
4.回滚完再次 opatchauto 仅给grid应用补丁 解决该问题。因为我发现db已经成功安装补丁了,如果不放心可以将二节点全部回滚,再次重新安装补丁。
##
总结一下:该故障做了2件事情
1.修改 $oraInventory/ContentsXML/oui-patch.xml 文件权限为 grid:oinstall rw-rw-r
2.拷贝 1节点的补丁包到2节点对应目录 /u01/app/19.3.0.0/grid/inventory/oneoffs/
3.回滚2节点已经安装的补丁
4.重新安装补丁。