今天给oracle打patch时遇到个问题,oracle版本为10204,报错内容如下:
OPatchSession cannot load inventory for the given Oracle Home /app/oracle/product/10.2.0/db_1. 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: OracleHomeInventory gets null oracleHomeInfo
OPatch failed with error code 73
查看权限和oracle home的设置均没有问题,所以问题应该出在Central Inventory上,于是输入下面命令:
opatch lsinventory -detail
发生如下报错:
Inventory load failed... OPatch cannot load inventory for the given Oracle Home.Possible causes are:
Oracle Home dir. path does not exist in Central Inventory
Oracle Home is a symbolic link
Oracle Home inventory is corrupted
LsInventorySession failed: OracleHomeInventory gets null oracleHomeInfo
OPatch failed with error code 73
可以看出提示oracle home在Central Inventory中不存在,Central Inventory记录了Oracle安装的所有组件,进入Central Inventory,发现这些信息均不存在。询问后得知,oracle在装好后这个目录就被删除了,所以就无法更新和打补丁了。[@more@]
修复方法:
./runInstaller -silent -attachHome -invPtrLoc ./oraInst.loc
ORACLE_HOME="" ORACLE_HOME_NAME=""
CLUSTER_NODES="" LOCAL_NODE=""
oracle重建Central Inventory后,补丁可以正常运行了。这个事件告诉我千万不要随意删除oracle下的目录或文件,幸好这次只是在测试库上出现,并且上述的情况还能修复。如果遇到不能修复的又是生产库,那后果。。。。。。