0 Comments

Inventory(1)

发布于:2012-12-04  |   作者:广州网站建设  |   已聚集:人围观

         什么是Inventory呢?Inventory是Oracle安装工具OUI用来管理Oracle安装目录的。Inventory里注册了某个ORACLE_HOME下安装的数据库的组件及其版本。Oracle数据库软件的升级、增删组件,都需要使用Inventory。在一台服务器上,Oracle OUI会创建一个全局的Inventory,全局Inventory的目录在oraInst.loc文件中指定。根据操作系统的不同,oraInst.loc所在的目录也不一样。在AIX或者LINUX等系统中,oraInst.loc存放在/etc目录下,在有些操作系统中,这个文件存放在/var/opt/oracle目录下。oraInst.loc文件中包含下面的配置项目:


  1. Inventory_loc=<oraInventory所在目录> 
  2. inst_group=<OUI安装ORACLE的操作系统组> 

 

        比如说,老白的一台测试机上的oraInst.loc内容是这样的:

  1. Inventory_loc=/opt/oracle/oraInventory  
  2. inst_group=oinstall 

         这里面有两个信息,第一个是Inventory所在的目录位置,第二个是安装Oracle的组的名称。这个inst_group参数十分重要,它会在link Oracle映像的时候被使用,如果这个参数设置错了,那么link出来的Oracle映像就无法被正常使用了。

         在全局Inventory中定义了所有Oracle HOME的情况,这个文件就是ContentsXML目录下的Inventory.xml:


  1. <?xml version="1.0" standalone="yes" ?> 
  2. <!-- Copyright (c) 2001 Oracle Corporation. All rights Reserved --> 
  3. <!-- Do not modify the contents of this file by hand. --> 
  4. <Inventory> 
  5. <VERSION_INFO> 
  6.    <SAVED_WITH>2.2.0.18.0</SAVED_WITH> 
  7.    <MINIMUM_VER>2.1.0.6.0</MINIMUM_VER> 
  8. </VERSION_INFO> 
  9. <HOME_LIST> 
  10. <HOME NAME="Ora10gHome1" LOC="/opt/oracle/product/10g" TYPE="O" IDX="1"/> 
  11. <HOME NAME="ora9i" LOC="/home/ora9i/product/9204" TYPE="O" IDX="2"/> 
  12. </HOME_LIST> 
  13. </Inventory> 

      比如上面的例子中,老白的系统上有两个Oracle Home,一个是9i的一个是10g的。

       在ORACLE_HOME下面也有一个Inventory目录,这个目录就是我们平时说的Local Inventory。这个Inventory是本地的,每个ORACLE_HOME所独有的。它记录了本ORACLE_HOME中OUI安装的组件的信息。

         了解了Inventory的一些基础知识,下面我们就要聊聊了解这些知识有什么好处了。假设这么一个场景,我们去给一个客户的数据库打补丁,到了客户现场,首先使用opatch lsInventory来查看一下当前系统的情况。正常情况显示的数据是这样的:


  1. Invoking OPatch 10.2.0.4.2  
  2. Oracle Interim Patch Installer version 10.2.0.4.2  
  3. Copyright (c) 2007, Oracle Corporation.  All rights reserved.  
  4. Oracle Home       : /opt/oracle/product/10g  
  5. Central Inventory : /opt/oracle/oraInventory  
  6. from              : /etc/oraInst.loc  
  7. OPatch version    : 10.2.0.4.2  
  8. OUI version       : 10.2.0.4.0  
  9. OUI location      : /opt/oracle/product/10g/oui  
  10. Log file location : /opt/oracle/product/10g/cfgtoollogs/opatch/opatch2011-05-06_11 -41-25AM.log  
  11. LsInventory Output file location : /opt/oracle/product/10g/cfgtoollogs/opatch/lsinv/ lsInventory2011-05-06_11-41-25AM.txt  
  12. --------------------------------------------------------------------------------  
  13. Installed Top-level Products (4):   
  14. Oracle Database 10g                                                  10.2.0.1.0  
  15. Oracle Database 10g Products                                         10.2.0.1.0  
  16. Oracle Database 10g Release 2 Patch Set 3                            10.2.0.4.0  
  17. Oracle Database Vault                                                10.2.0.4.0  
  18. There are 4 products installed in this Oracle Home.  
  19.  
  20. There are no Interim patches installed in this Oracle Home.
标签:
飞机