Thursday, July 12, 2012

oraenv returns XPointer evaluation failed: no locset

Using the oraanv script and getting "XPointer evaluation failed: no locset"?

Well I have a potential solution. There are a couple of causes of this error that I know of.

One is a bug - using oranev from an agent home.
It's not supported - it has to be from a database home. See 
"Running oraenv from the Grid Control Agent Oracle Home Fails [ID 1323684.1]"
"The oraenv is not meant to be run from the Grid Control 11.1.0.1 Agent ORACLE_HOME.This was diagnosed in BUG 10227734. The BUG will remove the oraenv from future agent installs....
Do not run oraenv to set the environment for the Grid Control Agent.Set the environment manually or using .sh script."
See the note for full details.

What if you are not using an agent home? 

Then the other cause I am aware of is this-

The oraenv script sets ORACLE_BASE. If it is not already set in the environment it calls a binary $ORACLE_HOME/bin/orabase.

orabase returns the ORACLE_BASE by looking in the Oracle Home's Inventory. It looks for the value in the file 
ORACLE_HOME/inventory/ContentsXML/oraclehomeproperties.xml 

This file it seems can sometimes lose the value of the Oracle Base, and if it does then orabase returns the XPointer evaluation failed: no locset error.

The file contents should look much like this:

<ORACLEHOME_INFO> 
   <GUID>973484272.77449395</GUID> 
   <HOME/> 
   <ARU_PLATFORM_INFO> 
      <ARU_ID>226</ARU_ID> 
      <ARU_ID_DESCRIPTION>Linux x86-64</ARU_ID_DESCRIPTION> 
   </ARU_PLATFORM_INFO> 
   <PROPERTY_LIST> 
      <PROPERTY NAME="ORACLE_BASE" VAL="/ora/oracle"/> 
   </PROPERTY_LIST> 
</ORACLEHOME_INFO> 

If the PROPERTY_LIST bit is missing, then you need to add it back in.
Set VAL= to be your Oracle Base - the example above is specific to MY environment.