欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

oraInventory目录的作用 有大用

What is oraInventory ?oraInventory is repository (directory) which store/records oracle software products & their oracle_homes location on a machine. This Inventory now a days in XML format and called as XML Inventory where as in past it used to be in binary format & called as binary Inventory.
There are basically two kind of Inventory Global Inventory (also called as Central Inventory) and Local Inventory also called as Oracle Home Inventory.

oraInventory中记录了oracle安装目录的相关信息,通常在oracle软件安装过程中会自动创建,路径通常会在/oracle_base/oraInventory/,并在/etc/oraInst.loc中记录相关的路径信息,有时候我们的oracle目录是从另一套相似环境中tar过来的,这个时候是不会有oraInventory信息,如果此时数据库需要升级,或者打psu,那么会报错

这时候就需要我们重建oraInventory信息,创建步骤如下:

step 1:编写/etc/oraInst.loc

[root@ORACLE11g-dg etc]# vim oraInst.loc

inventory_loc=/u02/oraInventory
inst_group=oinstall

step 2:运行runInstaller命令进行oraInventory重建工作

[oracle@ORACLE11g-dg database]$  ./runInstaller -silent -ignoreSysPrereqs -attachHome ORACLE_HOME="/u02/oracle/11.2.0/dbhome_1"

ORACLE_HOME_NAME="ORA11g"

Starting Oracle Universal Installer...

step 3:opatch 命令验证可用性

[oracle@ORACLE11g-dg OPatch]$ ./opatch lsinventory
Invoking OPatch 11.2.0.1.7

step 4:进入相关目录产看相关文件内容

ContentsXML  logs

来自 http://www.wallcopper.com/database/3089.html



在使用安装Oracle软件或者使用dbca创建数据库时,所有的日志都会放在oraInventory这个目录下。
默认情况下该目录会在$ORACLE_BASE/oraInventory,但是我们也可以通过更改/etc/oraInst.loc文件来指定具体的路径。
假设想修改该目录的路径可以修改oraInst.loc 文件
在linux下:
该文件路径为/etc/oraInst.loc

在hpunix下:
该文件路径为/var/opt/oracle/oraInst.loc


来自 https://zhidao.baidu.com/question/873711498390146972.html



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以上的版本,还可以直接运行attachHome.sh脚本:
$cd $ORACLE_HOME/oui/bin    
$./attachHome.sh
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.


来自 https://blog.csdn.net/caomiao2006/article/details/11901063/




普通分类: