记一次打PSU遇到OUI-67073:UtilSession failed: Your Oracle Home的问题处理

周六晚上同事在打PSU,总是打不上去,然后叫我去现场看一下,事先了解了一下这是一套Suse的环境,安装了Oracle 11.2.0.4的RAC数据库,现在要安装最新的PSU补丁。安装之前已经做了冲突检测,没有任何冲突。在手动打Grid的补丁出现问题。

grid -> 11g @hbjhdb1:/home/grid$/oracle/11.2.0/grid/OPatch/opatch napply -oh /oracle/11.2.0/grid -local /kdump/soft/27107360/26925576
Oracle Interim Patch Installer version 11.2.0.3.12
Copyright (c) 2018, Oracle Corporation.  All rights reserved.


Oracle Home       : /oracle/11.2.0/grid
Central Inventory : /oracle/app/oraInventory
   from           : /oracle/11.2.0/grid/oraInst.loc
OPatch version    : 11.2.0.3.12
OUI version       : 11.2.0.4.0
Log file location : /oracle/11.2.0/grid/cfgtoollogs/opatch/opatch2018-05-25_22-03-42PM_1.log

Verifying environment and performing prerequisite checks...
UtilSession failed: Your Oracle Home has a constituent installed without having its prereqalso installed. This is an error condition and we exit. The installed patch that is out of order is: 26609445
Log file location: /oracle/11.2.0/grid/cfgtoollogs/opatch/opatch2018-05-25_22-03-42PM_1.log

OPatch failed with error code 73

这个报错不是很明显,根据日志,进一步查看。

[May 25, 2018 10:03:45 PM]   OPatch invoked as follows: 'napply -oh /oracle/11.2.0/grid -local /kdump/soft/27107360/26925576 -invPtrLoc /oracle/11.2.0/grid/oraInst.loc '
[May 25, 2018 11:03:43 PM]   Could not get central inventory using NGOUI; oracle.sysman.nextgen.utils.NextGenInventoryUtil
[May 25, 2018 11:03:43 PM]   OUI-67077:
                             Oracle Home       : /oracle/11.2.0/grid
                             Central Inventory : /oracle/app/oraInventory
                                from           : /oracle/11.2.0/grid/oraInst.loc
                             OPatch version    : 11.2.0.3.12
                             OUI version       : 11.2.0.4.0
                             OUI location      : /oracle/11.2.0/grid/oui
                             Log file location : /oracle/11.2.0/grid/cfgtoollogs/opatch/opatch2018-05-25_22-03-42PM_1.log
[May 25, 2018 11:03:43 PM]   Patch history file: /oracle/11.2.0/grid/cfgtoollogs/opatch/opatch_history.txt
[May 25, 2018 11:03:45 PM]   [OPSR-MEMORY-1] : after installInventory.getAllCompsVect() call : 4 (MB)
[May 25, 2018 11:03:45 PM]   [OPSR-MEMORY-2] : before loading cooked one off : 7 (MB)
[May 25, 2018 11:03:46 PM]   [OPSR-MEMORY-3] : after loading rawOneOffList and before loading minipatch list in cooked one off : 7 (MB)
[May 25, 2018 11:03:46 PM]   [OPSR-MEMORY-4] : after filling cookedOneOffs and when inventory is loaded.. : 7 (MB)
[May 25, 2018 11:03:46 PM]   Verifying environment and performing prerequisite checks...
[May 25, 2018 11:03:46 PM]   Ignoring file "/kdump/soft/27107360/26925576/README.html" in the patch directory.
[May 25, 2018 11:03:46 PM]   Ignoring file "/kdump/soft/27107360/26925576/README.txt" in the patch directory.
[May 25, 2018 11:03:46 PM]   Ignoring file "/kdump/soft/27107360/26925576/patchmd.xml" in the patch directory.
[May 25, 2018 10:03:46 PM]   OUI-67073:UtilSession failed: Your Oracle Home has a constituent installed without having its prereqalso installed. This is an error condition and we exit. The installed patch that is out of order is: 26609445
[May 25, 2018 11:03:46 PM]   Finishing UtilSession at Fri May 25 22:03:46 CST 2018
[May 25, 2018 11:03:46 PM]   Log file location: /oracle/11.2.0/grid/cfgtoollogs/opatch/opatch2018-05-25_22-03-42PM_1.log
[May 25, 2018 11:03:46 PM]   Stack Description: java.lang.RuntimeException: Your Oracle Home has a constituent installed without having its prereqalso installed. This is an error condition and we exit. The installed patch that is out of order is: 26609445
[May 25, 2018 11:03:46 PM]   StackTrace: oracle.opatch.CompositePatchObject.GetIdenticalPatch(CompositePatchObject.java:1320)
[May 25, 2018 11:03:46 PM]   StackTrace: oracle.opatch.opatchutil.NApply.process(NApply.java:419)
[May 25, 2018 11:03:46 PM]   StackTrace: oracle.opatch.opatchutil.OUSession.napply(OUSession.java:1089)
[May 25, 2018 11:03:46 PM]   StackTrace: sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[May 25, 2018 11:03:46 PM]   StackTrace: sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[May 25, 2018 11:03:46 PM]   StackTrace: sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[May 25, 2018 11:03:46 PM]   StackTrace: java.lang.reflect.Method.invoke(Method.java:592)
[May 25, 2018 11:03:46 PM]   StackTrace: oracle.opatch.UtilSession.process(UtilSession.java:317)
[May 25, 2018 11:03:46 PM]   StackTrace: oracle.opatch.OPatchSession.main(OPatchSession.java:2580)
[May 25, 2018 11:03:46 PM]   StackTrace: oracle.opatch.OPatch.main(OPatch.java:634)

通过进一步查看日志我们可以发现,主要是报OUI-67073:UtilSession failed: Your Oracle Home has a constituent installed without having its prereqalso installed. This is an error condition and we exit. The installed patch that is out of order is: 26609445这个错误。解决这类问题一般查询MOS文档。通过MOS文档查到opatchauto fails: Your Oracle Home has a constituent installed without having its prereqalso installed (Doc ID 2157657.1)发现该问题和我们很接近。于是就采取文档里面的操作办法。首先查看inventory/oneoffs文件夹下面是否有补丁26609445。如果没有就拷贝该补丁进去。

grid -> 11g @hbjhdb1:/kdump/soft/27107360/26925576$cp -rp 26609445 /oracle/11.2.0/grid/inventory/oneoffs/

然后再次运行打补丁的操作,仍旧报错。

grid -> 11g @hbjhdb1:/kdump/soft/27107360/26925576$/oracle/11.2.0/grid/OPatch/opatch apply -oh /oracle/11.2.0/grid -local /kdump/soft/27107360/26925576
Oracle Interim Patch Installer version 11.2.0.3.12
Copyright (c) 2018, Oracle Corporation. All rights reserved.

Oracle Home : /oracle/11.2.0/grid
Central Inventory : /oracle/app/oraInventory
from : /oracle/11.2.0/grid/oraInst.loc
OPatch version : 11.2.0.3.12
OUI version : 11.2.0.4.0
Log file location : /oracle/11.2.0/grid/cfgtoollogs/opatch/opatch2018-05-25_22-37-06PM_1.log

Verifying environment and performing prerequisite checks...
UtilSession failed: Your Oracle Home has a constituent installed without having its prereqalso installed. This is an error condition and we exit. The installed patch that is out of order is: 26609445
Log file location: /oracle/11.2.0/grid/cfgtoollogs/opatch/opatch2018-05-25_22-37-06PM_1.log

OPatch failed with error code 73

通过查看该文件夹下其他补丁,发现就只有etc和jlib文件夹,而我们拷贝过去的有很多目录,将这些多出来的目录删除之后再次尝试。

grid -> 11g @hbjhdb1:/oracle/11.2.0/grid/inventory/oneoffs/25869727$ls
etc jlib
grid -> 11g @hbjhdb1:/oracle/11.2.0/grid/inventory/oneoffs/26609445$ls
README.html README.txt etc files jlib
grid -> 11g @hbjhdb1:/oracle/11.2.0/grid/inventory/oneoffs/26609445$rm -rf README.html
grid -> 11g @hbjhdb1:/oracle/11.2.0/grid/inventory/oneoffs/26609445$rm -rf README.txt
grid -> 11g @hbjhdb1:/oracle/11.2.0/grid/inventory/oneoffs/26609445$rm -f files
grid -> 11g @hbjhdb1:/oracle/11.2.0/grid/inventory/oneoffs/26609445$/oracle/11.2.0/grid/OPatch/opatch apply -oh /oracle/11.2.0/grid -local /kdump/soft/27107360/26925576
Oracle Interim Patch Installer version 11.2.0.3.12
Copyright (c) 2018, Oracle Corporation. All rights reserved.

Oracle Home : /oracle/11.2.0/grid
Central Inventory : /oracle/app/oraInventory
from : /oracle/11.2.0/grid/oraInst.loc
OPatch version : 11.2.0.3.12
OUI version : 11.2.0.4.0
Log file location : /oracle/11.2.0/grid/cfgtoollogs/opatch/opatch2018-05-25_22-38-52PM_1.log

OPatchSession cannot load inventory for the given Oracle Home /oracle/11.2.0/grid. Possible causes are:
No read or write permission to ORACLE_HOME/.patch_storage
Central Inventory is locked by another OUI instance
No read permission to Central Inventory
The lock file exists in ORACLE_HOME/.patch_storage
The Oracle Home does not exist in Central Inventory

UtilSession failed: Unable to create patchObject
Possible causes are:
ORACLE_HOME/inventory/oneoffs/26609445 is corrupted. PatchObject constructor: Input file "/oracle/11.2.0/grid/inventory/oneoffs/26609445/etc/config/actions" or "/oracle/11.2.0/grid/inventory/oneoffs/26609445/etc/config/inventory" does not exist.

Log file location: /oracle/11.2.0/grid/cfgtoollogs/opatch/opatch2018-05-25_22-38-52PM_1.log

OPatch failed with error code 73

把一些东西删除之后,居然报26609445 is corrupted。难道软件包是有问题的。此时此刻真的不知道该如何解决了,因为MOS文档就是把这个包复制进去,然后重新运行打补丁的命令就成功了,而我们这里按照文档做是不成功的。难道是26609445这个包下的有问题吗?于是我把这个26609445文件夹的内容清空了,想着在复制一遍进去。但是鬼使神差的,想清空了文件夹在执行一遍看看会不会有什么变化,结果发现输出变了。

grid -> 11g @hbjhdb1:/oracle/11.2.0/grid/inventory/oneoffs$rmdir 26609445
grid -> 11g @hbjhdb1:/oracle/11.2.0/grid/inventory/oneoffs$ls
17478514 18031668 18522509 19121551 19769489 20299013 20760982 21352635 21948347 22502456 22502505 23054359 24006111 24732075 25869727 26609929
grid -> 11g @hbjhdb1:/oracle/11.2.0/grid/inventory/oneoffs$/oracle/11.2.0/grid/OPatch/opatch apply -oh /oracle/11.2.0/grid -local /kdump/soft/27107360/26925576
Oracle Interim Patch Installer version 11.2.0.3.12
Copyright (c) 2018, Oracle Corporation. All rights reserved.

Oracle Home : /oracle/11.2.0/grid
Central Inventory : /oracle/app/oraInventory
from : /oracle/11.2.0/grid/oraInst.loc
OPatch version : 11.2.0.3.12
OUI version : 11.2.0.4.0
Log file location : /oracle/11.2.0/grid/cfgtoollogs/opatch/opatch2018-05-25_22-42-27PM_1.log

OPatchSession cannot load inventory for the given Oracle Home /oracle/11.2.0/grid. Possible causes are:
No read or write permission to ORACLE_HOME/.patch_storage
Central Inventory is locked by another OUI instance
No read permission to Central Inventory
The lock file exists in ORACLE_HOME/.patch_storage
The Oracle Home does not exist in Central Inventory

UtilSession failed: Unable to create patchObject
Possible causes are:
ORACLE_HOME/inventory/oneoffs/26609445 is corrupted.
No read permission to above directory
Please remove one-off entry [ 26609445 ] from /oracle/11.2.0/grid/inventory/ContentsXML/comps.xml and retry if above directory corrupted, or Please check the contents of the directory ORACLE_HOME/inventory/oneoffs/26609445 for read permission
Log file location: /oracle/11.2.0/grid/cfgtoollogs/opatch/opatch2018-05-25_22-42-27PM_1.log

OPatch failed with error code 73

这里的报错太明显了,让我们把entry [ 26609445 ] 从/oracle/11.2.0/grid/inventory/ContentsXML/comps.xml 这个文件里面移除。

移除掉这XML中的记录,在打补丁,居然补丁成功安装了。然后在安装2节点的时候,直接就把这个文件进行了相同的修改方式,删除了26609445这一行记录就能安装成功了。

关注dbDao.com的新浪微博

扫码加入微信Oracle小密圈,了解Oracle最新技术下载分享资源

TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569