19C 节点2打补丁由于oui-patch.xml权限异常处理
(1)问题概述
当第一个节点的GI、DB顺利打完补丁后(19.3升级到19.x版本),我就照着节点1的步骤对节点2进行打补丁。在进行节点2的DB补丁安装时,在快完成的时候报错了,从报错信息可以很容易的看出是/u01/app/oraInventory/ContentsXML/oui-patch.xml这个文件的权限导致的。查看该文件的权限:
# ls -lrt /u01/app/oraInventory/ContentsXML/oui-patch.xml
-rw-r--r-- 1 grid oinstall 174 Mar 6 12:50 /u01/app/oraInventory/ContentsXML/oui-patch.xml
对于oracle用户只有读的权限,所以导致IO异常,从opatch的日志也可以看出:
[OPSR-TIME] Finished modifying the system for patch 30557433
ApplySession adding interim patch '30557433' to inventory
[OPSR-TIME] Saving patch 30557433 to inventory
OUI-67124:ApplySession failed in system modification phase... 'ApplySession::apply failed: java.io.IOException: oracle.sysman.oui.patch.PatchException: **java.io.FileNotFoundException: /u01/app/oraInventory/ContentsXML/oui-patch.xml (Permission denied)**'
根据报错将文件权限修改为660,在执行仍然报错:
#chmod 660 /u01/app/oraInventory/ContentsXML/oui-patch.xml
opatch-external.jar is in /u01/app/oracle/product/19c/db/OPatch/jlib/opatch-external.jar
Unable to create patchObject
Possible causes are:
ORACLE_HOME/inventory/oneoffs/30557433 is corrupted. PatchObject constructor: Input file "/u01/app/oracle/product/19c/db/inventory/oneoffs/30557433/etc/config/actions" or "/u01/app/oracle/product/19c/db/inventory/oneoffs/30557433/etc/config/inventory" does not exist.
OUI-67073:UtilSession failed: NApply was not able to get the list of patches to apply.
Finishing UtilSession at Fri Mar 06 13:00:15 CST 2020
进了 $ORACLE_HOME/inventory/oneoffs/目录进行查看,发现该目录下没有30557433:
重新对DB执行打补丁命令失败了,所以,认为对oui-patch.xm文件权限的修改一定要及时。既然不能重新打补丁,只能选择回滚了
然后将节点1目录下
scp $ORACLE_HOME/inventory/oneoffs/30* node2:$ORACLE_HOME/inventory/oneoffs/30*
opatch rollback -id 30557433
opatch apply -oh $ORACLE_HOME -local /RU/XX/30557433
处理完成。
(2)总结如下:
1 在从19.3 升级到任何版本ru补丁时,在第2个节点更新DRU补丁时,注意文件
/u01/app/oraInventory/ContentsXML/oui-patch.xml权限,或者直接调整为660。