Thursday, January 14, 2010

Adding an Oracle home to an agent inventory

When an Oracle inventory is saved in a non-standard location, the Oracle Grid Control agent can be unable to enumerate the software that is in that Oracle Home. This is true even when it can find the home itself.
In OEM, you’ll run into an error like that below when you click on the home in the Targets list:

Error Could not find Oracle Home <ORACLE_HOME> in the inventory collected for <hostname>

We’ll use TESTSRV2 as a troubleshooting example.

Locate the oraInst.loc file

The oraInst.loc file contains the inventory for all of the Oracle software. Normally, Oracle maintains a single copy of this file, but when one is saved in a non-standard directory, it can get left out.

The first thing we’ll do is find out where all of the oraInst.loc files are located.
[root@testsrv2 ~]# locate oraInst.loc
/oracle/install/920/scripts/silent/oraInst.loc
/oracle/install/817/scripts/silent/oraInst.loc
/OLD_TREES/a18_1/oracle/install/920/scripts/silent/oraInst.loc /OLD_TREES/a18_1/oracle/install/817/scripts/silent/oraInst.loc
/app/oraInventory/oraInst.loc
/app/oracle/product/920/oraInst.loc
/app/oracle/product/102/oraInst.loc
/app/oracle/OracleHomes/agent10g/oraInst.loc
We can see that there are a lot of oraInst.loc files on this server. The file in the OracleHome/agent10g directory is the agent inventory. Some looking shows that the oraInst.loc file in the /app/oracle/product/102 directory is the most recent of all of the others, so we’ll use that one.

Add the additional inventory file to the agent search

There is a file that the agent uses to add inventories to its search list. This is the OUInventories.add file in the <AGENT_HOME>/sysman/config/ directory. So we edit it:
[root@testsrv2 ~]# vim /app/oracle/OracleHomes/agent10g/sysman/config/OUIinventories.add
[root@testsrv2 ~]#
And add the appropriate line:
image
Save that file and exit the editor.

Restart the agent

This change requires a restart of the agent:
/app/oracle/OracleHomes/agent10g/bin/emctl stop agent /app/oracle/OracleHomes/agent10g/bin/emctl start agent

Refresh the Host Configuration

Having restarted the agent, we now have to tell Grid Control to refresh its list of the software on that host:
Navigate to Depoloyments -> Refresh Host Configurationclip_image006
clip_image004
Add the host to the “selected hosts” pane and click on the “refresh hosts” button. This will populate the appropriate agent data, and you’re done.

1 comment:

Thanks for leaving a comment!