Thursday, February 4, 2010

How to use non-default inventory location pointer with opatch

Hi,
This post again, is not a "fix-a-problem" kind of post. This is more to do with how to work around a tight spot and hence dont be surprised to see the disclaimer at the end!

If you are in a situation where you need to use a inventory location pointer from a non-default location, you can use the following command:

a. to query:
opatch lsinventory -invPtrLoc [full path to oraInst.loc]
eg. opatch lsinventory -invPtrLoc /apps/sdev/apps/tech_st/10.1.2/oraInst.loc

b. to apply a patch:

opatch apply -invPtrLoc [full path to oraInst.loc]
eg. opatch apply -invPtrLoc /apps/sdev/apps/tech_st/10.1.2/oraInst.loc

Just to add, the default location of the oraInst.loc file will be /etc/oraInst.loc and/or /var/opt/oracle/oraInst.loc. You might encounter a situation wherein there are multiple oracle homes on the same server and multiple maintenance activities are happening in parallel, in which case, if your oraInst.loc at non-default location has the correct location of the oracle inventory of the desired oracle home, you have the flexibility of using the same.

Further, if you dont have an inventory, you can create one using the following steps:

1. Define an inventory location for the new inventory information to be created.
2. Create the empty oraInventory directory with the appropriate shell username (who owns the oracle home file system) in the path specified in oraInst.loc

3. $./runInstaller -silent -attachHome -invPtrLoc /var/opt/oracle/oraInst.loc ORACLE_HOME="[full_path_to_ORACLE_HOME]" ORACLE_HOME_NAME="[ORACLE_HOME_NAME]"

DISCLAIMER: The above steps have worked well for me in various situations in the past, but I cannot guarantee that this will work well in all situations. Hence, please use your discretion if you plan to use these commands. You will be doing the same at your own risk. Have adequate back-out measures in place before you try the aforesaid steps in particular and any step from any of my other posts in general :)

- Aravind Kamath Posral

No comments: