Friday, September 24, 2010

How to obtain Oracle Inventory for your Oracle Home

Hello,

Here is a "how to" post.

Requirement:

You have accidentally deleted the oracle inventory or the oracle inventory is corrupt. You need the oracle inventory to be able to apply some patch using Opatch.

How to obtain your inventory back:

a. If your database is RAC:

$ORACLE_HOME/oui/bin/runInstaller -attachHome -local -invPtrLoc /var/opt/oracle/oraInst.loc ORACLE_HOME="/oracle/product/10.2.0.4/ORADB"
ORACLE_HOME_NAME="oradb_home_10_2_0_4" "CLUSTER_NODES={db-host-01,db-host-02}" LOCAL_NODE="db-host-01"

The above command will only update the inventory on the local node (where the command is being run) without affecting the other nodes in the cluster.

b. If your database is non-RAC:

$ORACLE_HOME/oui/bin/runInstaller -attachHome -invPtrLoc /var/opt/oracle/oraInst.loc ORACLE_HOME="/oracle/product/10.2.0.4/ORADB" ORACLE_HOME_NAME="oradb_home_10_2_0_4"


I believe this should work well with 11g db also.

Disclaimer: Please make sure to test these commands thoroughly if you plan to use these in your environment. These commands have worked well for me in the past, but you should use your judgement if you plan to use them in your environment. Ultimately, you are responsible for the outcome! :)


- Aravind Kamath Posral

No comments: