opatch: The Central Inventory is corrupted
opatch lsinv和opatch lspatches都報錯:
The Central Inventory is corrupted
The oraInst.loc file specified is not valid.
nzportadb:/u01/app/oracle>$ORACLE_HOME/OPatch/opatch lsinventory Oracle Interim Patch Installer version 11.2.0.3.19 Copyright (c) 2018, Oracle Corporation. All rights reserved. Oracle Home : /u01/app/oracle/product/11.2.0/db_1 Central Inventory : /u01/app/oraInventory from : /etc/oraInst.loc OPatch version : 11.2.0.3.19 OUI version : 11.2.0.4.0 Log file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2018-10-09_18-26-37PM_1.log LsInventorySession failed: OPatch failed to locate Central Inventory. Possible causes are: The Central Inventory is corrupted The oraInst.loc file specified is not valid.
查看了 /u01/app/oraInventory目錄存在,OPatch許可權正確
後來查找了楊總的一篇文章:
找到了解決辦法
修改/etc/oraInst.loc 檔案
當前我的
inventory_loc=/u01/app/oraInventory
但是實際上產品目錄在
inventory_loc=/u01/app/oracle/oraInventory
修改好就可以正常執行了(我的/u01/app/oraInventory是沒有什麼東西的,/u01/app/oracle/oraInventory是有檔案和目錄的)