Tuesday, January 29, 2008

When the Grid Agent couldnt find any target on host...

Subject: Manually adding targets to EM Grid Agent installed on a host.

Problem: As the installation procedure finishes successfully on a target host, EM agent examines "/etc/oratab" file (on UNIX operating system) to find the installed oracle products on the host. What if the specified file doesnt exist or somehow agent couldnt read the file?

Solution: Before the installation, you should check "/etc/oratab" file if it exists. If not, check the "/var/oracle" directory for the oratab file and make symbolic link named oratab under "/etc" directory.

If the agent cannot find any target on the host in all circumstances you can try adding the targets manually after installation. You will find configuration file, template entry for a "database" and a "listener".

EM Agent stores target information in targets.xml file located at "$AGENT_HOME/sysman/emd" directory. A sample file without any targets can be find as follows.

<Targets AGENT_TOKEN="e7244b84afad62c94aad53fe407af2514e3b7f04">
<Target TYPE="oracle_emd" NAME="oragrid:3872"/>
<Target TYPE="host" NAME="oragrid"/>

You can add a listener as a target to targets.xml file by using the following template. (values between the three stars - *** *** - are system specific. You should use your own systems parameters instead of *** *** values)

<Target TYPE="oracle_listener" NAME="***LISTENER_NAME***">
<Property NAME="ListenerOraDir" VALUE="$ORACLE_HOME/network/admin"/>
<Property NAME="LsnrName" VALUE="***LISTENER_NAME***"/>
<Property NAME="Machine" VALUE="***HOSTNAME***"/>
<Property NAME="OracleHome" VALUE="***$ORACLE_HOME***"/>
<Property NAME="Port" VALUE="***LISTENER_PORT***"/>

The following template is for manually entering database target to a EM Agent. (values between the three stars - *** *** - are system specific. You should use your own systems parameters instead of *** ... *** values)

<Target TYPE="oracle_database" NAME="***DB_NAME***"/>
<Property NAME="OracleHome" VALUE="***$ORACLE_HOME***"/>
<Property NAME="UserName" VALUE="dbsnmp"/>
<Property NAME="MachineName" VALUE="***HOSTNAME***"/>
<Property NAME="Port" VALUE="1521"/>
<Property NAME="SID" VALUE="***$ORACLE_SID***"/>
<Property NAME="ServiceName" VALUE="***$SERVICE_NAME***"/>
<Property NAME="password" VALUE="***PASSWORD***" ENCRYPTED="FALSE"/>
<Property NAME="Role" VALUE="NORMAL"/>

After you are done with your "targets.xml" file you should run emctl reload agent to read the configuration files from scratch. You can check the defined targets by running emctl config agent listtargets

1 comment:

  1. last week one of my colleagues had some problems to obtain crs information through grid agent. here is the solution that he does.

    ./runInstaller -clusterware oracle.crs, -crsLocation /product/10g/crs