1 清单目录重建
- 清单文件的路径信息记录在/etc/oraInst.loc文件中(solars /var/opt/oracle/oraInst.loc)
- 清单文件还存在于 ORACLE_HOME下 oraInst.loc
- 需要保持一致
报错信息如下:
LsInventorySession failed: OPatch failed to locate Central Inventory.
Possible causes are:
The Central Inventory is corrupted
The oraInst.loc file specified is not valid.
更新正确的oraInst.loc文件,然后执行脚本
cd $ORACLE_HOME/oui/bin
-bash-3.00$ ./attachHome.sh
Starting Oracle Universal Installer...Checking swap space: must be greater than 500 MB. Actual 125998 MB Passed
The inventory pointer is located at /var/opt/oracle/oraInst.loc
The inventory is located at /zh/oracle/oraInventory
'AttachHome' was successful.
-bash-3.00$ ls
脚本如下 (增加或者删除ORACLE_HOME到清单表中)
cd $ORACLE_HOME/oui/bin
./runInstaller -silent -attachHome ORACLE_HOME=$ORACLE_HOME ORACLE_HOME_NAME="ORACLE_HOME"
修改ORACLE_HOME_NAME值
有些时候,我们可能会遇到这样的问题,就是想更改一下ORACLE_HOME_NAME。
而直接修改 oraInventory/ContentsXML/inventory.xml 中的值并不安全。Oracle 是提供了这样的功能的。
要想修改此变量的值,首先,要detatch home,然后再attach home. 命令格式如下:
detachHome
<ORACLE_HOME>/oui/bin/runInstaller -detachHome ORACLE_HOME=<Full_Path_to_Home> ORACLE_HOME_NAME=<name of oracle home> -invPtrLoc <Full_Path_to_OraInst.loc_File>
attachHome
<ORACLE_HOME>/oui/bin/runInstaller -attachHome ORACLE_HOME=<Full_Path_to_Home> ORACLE_HOME_NAME=<name of oracle home> -invPtrLoc <Full_Path_to_OraInst.loc_File>