ITPUX技术网

交流 . 资讯 . 分享
Make progress together!
Oracle数据库DBA高级工程师培训视频
Oracle数据库培训-备份恢复-性能优化-集群容灾
mysql数据库视频教程

Oracle中Inventory目录作用以及如何重建Inventory目录

内容发布:风哥| 发布时间:2015-12-7 16:23:04
Oracle中Inventory目录作用以及如何重建Inventory目录
oraInventory存放的是Oracle软件安装的目录信息,Oralce的安装升级都需要用到这个目录,来看看Oracle文档中对这个目录的一点说明:

All Oracle software installations rely on this directory.
Ensure that you back it up regularly.
Do not delete this directory unless you have completely removed
all Oracle software from the system.

oraInventory目录的位置是由oraInst.loc文件决定的:
/etc/oraInst.loc (AIX and Linux Platform)
/var/opt/oracle/OraInst.loc (Solaris and HP-UX platform)

$cat /etc/oraInst.loc
inventory_loc=/app/oracle/oraInventory
inst_group=dba

删除或丢失oraInventory目录的内容,都有可能导致升级报错,例如在运行opatch时就有可能遇到以下报错:

10G中:
$opatch lsinventory

Invoking OPatch 10.2.0.4.3

OPatch failed to locate Central Inventory.
Possible causes are:
    The Central Inventory is corrupted
    The oraInst.loc file specified is not valid.
LsInventorySession failed: OPatch failed to locate Central Inventory.
Possible causes are:
    The Central Inventory is corrupted
    The oraInst.loc file specified is not valid.

OPatch failed with error code 73
$opatch lsinventory
Invoking OPatch 10.2.0.4.3

List of Homes on this system:

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

9I中报错:
OPATCH_JAVA_ERROR  : An exception of type "OPatchException" has occurred:
OPatch Exception:
  Can not lock OUI inventory (READ/WRITE Level)
  An exception occurs
  The inventory pointed at location /app/oraInventory is not valid

There is no Interim Patch

Can not get a list of inventory on this home.
LsInventory: OPatch Exception while accessing O2O

OPATCH_JAVA_ERROR  : An exception of type "OPatchException" has occurred:
OPatch Exception:
  OUI found no such ORACLE_HOME set in the environment
  Can not get details for given Oracle Home
  An exception occurs
  null

There is no Interim Patch

Can not get a list of inventory on this home.

ERROR: OPatch failed because of Inventory problem.

在10G中可以运行以下命令进行oraInventory目录重建:
$cd $ORACLE_HOME/oui/bin
$./runInstaller -silent -attachHome \
> ORACLE_HOME=$ORACLE_HOME \
> ORACLE_HOME_NAME="ORACLE_HOME"


Starting Oracle Universal Installer...

No pre-requisite checks found in oraparam.ini,
no system pre-requisite checks will be executed.
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /app/oracle/oraInventory
'AttachHome' was successful.
js_znjh_1./app/oracle/product/10.2.0/db_1/oui/bin$

10.2.0.2以上的版本及11g以后,可以直接运行attachHome.sh脚本:

$cd $ORACLE_HOME/oui/bin   
$./attachHome.sh


No pre-requisite checks found in oraparam.ini,
no system pre-requisite checks will be executed.
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /app/oracle/oraInventory
'AttachHome' was successful.

以下是12C RAC的情况,要在第一个节点上运行完成后再到第第二个节点运行

[grid@itpux1:/oracle/app/12.1.0.2/grid/oui/bin]$./attachHome.sh
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 8191 MB    Passed
The inventory pointer is located at /etc/oraInst.loc
'AttachHome' was successful.


[grid@itpux2:/oracle/app/oraInventory/ContentsXML]$cd $ORACLE_HOME/oui/bin
[grid@itpux2:/oracle/app/12.1.0.2/grid/oui/bin]$./attachHome.sh
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 8191 MB    Passed
The inventory pointer is located at /etc/oraInst.loc
'AttachHome' was successful.




上一篇:Oracle逻辑导出时出现EXP ORA-01455故障排查
下一篇:Oracle12cRAC安装遭遇CLSRSC-507: The root script cannot proceed on this node
189070296,150201289

专业提供Oracle数据库服务、主机、存储、备份、中间件等相关技术支持服务,QQ号:176140749
关注ITPUX技术网微信公众号itpux_com  ,了解本站最新技术资料的分享.

欢迎加QQ群,提供超多高质量Oracle/Unix/Linux技术文档与视频教程的下载。

Oracle/MySQL/Linux群4-5:189070296  150201289  
Oracle/MySQL/Linux群6-8:244609803   522261684   522651731
备注:请勿重复加群,另请注明 from itpux

加群分享视频教程部分如下:

1、公开课视频:Oracle/MySQL数据库工程师职业发展前景讲解(免费)
http://edu.51cto.com/course/7015.html

2、51CTO学院Oracle数据库高级工程师培训(高薪就业.课程介绍)
http://edu.51cto.com/px/train/131?xiaotu

3、Oracle DBA数据库高级工程师培训视频课程1.1(系列78套+七大阶段+上千案例)
套餐视频地址: http://edu.51cto.com/topic/1121.html

4、MySQL数据库(终身门徒)套餐:http://edu.51cto.com/sd/1e1a6

回复

使用道具 举报

1框架
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表