This discussion is archived
6 Replies Latest reply: Jan 24, 2013 12:19 PM by EdStevens RSS

Understanding inventory

EdStevens Guru
Currently Being Moderated
Oracle GI 11.2.0.1.0
Oracle db 11.2.0.1.0
Oracle Linux 5.6 x86-64
ASM standalone, NO RAC.

Background
For a few years now I’ve been using VMworkstation and (more recently) VirtualBox to create personal sandbox systems. These have all been somewhat generic, ‘right out of the box’ installations. Now I am trying to create sandbox versions of each of my 4 ‘live’ systems. I want these to be configured as closely as possible to match the corresponding live system. As a result I am paying much more attention to all the details.

To assist in this effort I wrote a script to report on the current state of the inventory. This script does the following
-     Extract the inventory location from /etc/oraInst.loc
-     From the indicated location, parse ../contentsXML/inventory.xml to get the names and locations of all installed oracle homes
-     Use the parsed information to generate a secondary script that will report on each home, then execute that secondary sript.

The secondary script typically looks like this:
echo ========================
echo HOST: `hostname`
echo
echo HOME NAME: Ora11g_gridinfrahome1   IDX: 1
echo
ORACLE_HOME=/u01/app/oracle/product/11.2.0/grid
echo ---- oratab usage ----
grep $ORACLE_HOME: /etc/oratab
echo --------
$ORACLE_HOME/OPatch/opatch lsinventory
echo ========================
echo HOST: `hostname`
echo
echo HOME NAME: OraDb11g_home1   IDX: 2
echo
ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
echo ---- oratab usage ----
grep $ORACLE_HOME: /etc/oratab
echo --------
$ORACLE_HOME/OPatch/opatch lsinventory
The literals for HOME NAME, IDX, and ORACLE_HOME were extracted from the inventory.xml file. The exact values, and the number of homes reported will obviously depend on the contents of inventory.xml, and that is the point of the script. I can drop it on any of my linux servers, as the script itself is driven by the inventory on that server.

Issue
Now, when I run this on a newly created sandbox which has two homes – one ASM and one db, I see this output from the ‘opatch lsinventory’. Pay attention to the "central inventory ... from " information.
Oracle Home       : /u01/app/oracle/product/11.2.0/grid
Central Inventory : /u01/app/oraInventory
   from           : /etc/oraInst.loc
.
.
Oracle Home       : /u01/app/oracle/product/11.2.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /etc/oraInst.loc
And as a point of reference:
oracle:orcl$ cat /etc/oraInst.loc
inventory_loc=/u01/app/oraInventory
inst_group=oinstall
While I’ve never paid close attention to those lines from lsinventory before, the above is what I’d expect from a position of relative ignorance on these details.

But if from a live server, with the same starting point:
oracle:orcl$ cat /etc/oraInst.loc
inventory_loc=/u01/app/oraInventory
inst_group=oinstall
I get
Oracle Home       : /u01/app/oracle/product/11.2.0/grid
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/11.2.0/grid/oraInst.loc.
.
.
Oracle Home       : /u01/app/oracle/product/11.2.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/11.2.0/db_1/oraInst.loc
So, on the new sandbox, it seems that lsinventory started its search at /etc/oraInst.loc, while on the live system it started at $ORACLE_HOME/oraInst.loc. Both ended up at the same place, but I don’t understand the mechanism that indicated a different starting point on the two systems.

Perhaps I’m obsessing over a nit, but I’d really like to understand the difference.
  • 1. Re: Understanding inventory
    damorgan Oracle ACE Director
    Currently Being Moderated
    I vote for obsessing ... but if that is your choice ... open an SR at MOS and then be a bit patient.
  • 2. Re: Understanding inventory
    Dude! Guru
    Currently Being Moderated
    The correct location is /etc/oraInst.loc. The opatch utility will run into trouble if it is not there.

    Is the /etc/orainst a symlink? There are some references on the web if you serach for "export ORAINST", though I wonder if this parameter really exists. It does ring a faint bell though, perhaps Oracle 8i? You might want to search oracle support for "invptrloc".
  • 3. Re: Understanding inventory
    EdStevens Guru
    Currently Being Moderated
    damorgan wrote:
    I vote for obsessing ... but if that is your choice ... open an SR at MOS and then be a bit patient.
    Well, obsessing has allowed me to achieve what I have in this career, in spite of my "formal" (university) training being totally unrelated. (see my soapbox contribution to [url https://forums.oracle.com/forums/message.jspa?messageID=10811970#10811970]this thread
    ;-)

    As for MOS ... nah, I'm too close to retirement to wait on them. I don't even buy green bananas any more.

    I'll chip away at this one a bit more, at least until I run out of leads. If I find anything I'll post it for posterity.
  • 4. Re: Understanding inventory
    EdStevens Guru
    Currently Being Moderated
    Dude wrote:
    The correct location is /etc/oraInst.loc. The opatch utility will run into trouble if it is not there.

    Is the /etc/orainst a symlink? There are some references on the web if you serach for "export ORAINST", though I wonder if this parameter really exists. It does ring a faint bell though, perhaps Oracle 8i? You might want to search oracle support for "invptrloc".
    Nope. Not a symlink.

    Both the production and sandbox systems have an oraInst.loc located at
    - /etc
    - grid home
    - db home

    And all six of them (3 on prod, 3 on sandbox) are identical:
    oracle:vborcl$ cat oraInst.loc
    inventory_loc=/u01/app/oraInventory
    inst_group=oinstall
    The primary purpose for building these sandboxes is to have a testbed for the application of upgrades and patches. So while some differences can be written off, things dealing with opatch and inventory bear some extra attention. If nothing else, now my curiosity has been piqued, and for me, that's like throwing red meat to a wolf.
  • 5. Re: Understanding inventory
    Srini Chavali-Oracle Oracle ACE Director
    Currently Being Moderated
    Can you post the timestamps of the 3 oraInst.loc files ? Could it be that someone copied the /etc/oraInst.loc file to the grid and dbhomes and opatch is finding them in the PATH first (before the one in etc) ?

    HTH
    Srini
  • 6. Re: Understanding inventory
    EdStevens Guru
    Currently Being Moderated
    Found it!

    Well, not completely, but enough for my question. It has to do with the version of opatch.

    Immediately after the initial installation of GI, my report showed as:
    Invoking OPatch 11.1.0.6.6
    
    Oracle Interim Patch Installer version 11.1.0.6.6
    Copyright (c) 2009, Oracle Corporation.  All rights reserved.
    
    
    Oracle Home       : /u01/app/oracle/product/11.2.0/grid
    Central Inventory : /u01/app/oraInventory
       from           : /etc/oraInst.loc
    OPatch version    : 11.1.0.6.6
    OUI version       : 11.2.0.1.0
    OUI location      : /u01/app/oracle/product/11.2.0/grid/oui
    Then I copied the entire OPatch directory from the production server to my sandbox, and immediately re-ran the script.
    Oracle Interim Patch Installer version 11.2.0.3.0
    Copyright (c) 2012, Oracle Corporation.  All rights reserved.
    
    
    Oracle Home       : /u01/app/oracle/product/11.2.0/grid
    Central Inventory : /u01/app/oraInventory
       from           : /u01/app/oracle/product/11.2.0/grid/oraInst.loc
    OPatch version    : 11.2.0.3.0
    OUI version       : 11.2.0.1.0
    So it would appear there was a change of behavior in opatch in where it looks for the oraInst.loc file. I'll spend a bit more time to see if I can find where that was documented. NOT looking first in /etc (or /var/opt in other *nix flavors) flies in the face of what documentation I've seen so far.

    =======
    Hey, at least no one can accuse me of asking the same tired old documentation question! :-)

    Edited by: EdStevens on Jan 24, 2013 2:18 PM

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points