Oracle DBA – A lifelong learning experience

Posts Tagged ‘emctl’

Removing a grid target from the OMS

Posted by John Hallas on January 7, 2009

The problem

 We have a data (normal usage) and a management connection to each server.

In one case the /etc/hosts file has been set up incorrectly so that the entry looked like

 

10.1.2.3 server.unix.companyname.net server-data server

 

When the agent was started it registered the targets on that server as

 

listener_server.server_data.unix.companyname.net

 

whereas we wanted it to match all the others servers and use the full name and not the alias

 

Listener_server.server.unix.companyname.net

 

I deleted all the targets I could from grid control but could not remove the host and the agent.

I tried every permutation of emctl remove target but still with no success so I decided to do it from the management server side.

  

select distinct target_name,target_type  from SYSMAN.MGMT$TARGET where target_name like ‘%server%’

 

TARGET_NAME TARGET_TYPE

—————————————————————-

server-data.unix.companyname.net:3872 oracle_emd

server-data.unix.companyname.net host

 

 

SQL> select distinct target_name,target_type  from SYSMAN.MGMT$TARGET where target_name like ‘%server%’

 

TARGET_NAME TARGET_TYPE

——————————————————————————–

server-data.unix.companyname.net:3872 oracle_emd

server-data.unix.companyname.net host

 

SQL> exec sysman.mgmt_admin.cleanup_agent(‘server-data.unix.companyname.net:3872’);

 

SQL> exec sysman.mgmt_admin.cleanup_agent(‘server-data.unix.companyname.net ‘);

 

PL/SQL procedure successfully completed.

 

SQL> select distinct target_name,target_type  from SYSMAN.MGMT$TARGET where target_name like ‘%server%’;

 

no rows selected

 

 

I was then in a position to do a discover and re-register the server with OMS

 

agentca -d

Posted in Grid control and agents, Oracle | Tagged: , , , | Leave a Comment »

Clearing an Enterprise manager agent that fails to upload

Posted by John Hallas on December 10, 2008

This is the standard set of actions that I go through when I have problems with an EM agent that a stop/start/upload does not resolve

The two types of errors I generally see are

EMD upload error: uploadXMLFiles skipped :: OMS version not checked yet..

Starting agent …………………………… started but not ready.

Follow the steps below, which can be cut and pasted

export AGENT_HOME=/app/oracle/product/gc10.2/agent10g/

Stop the agent

$AGENT_HOME/bin/emctl stop agent

Remove the old log files from AGENT_HOME/sysman/log

Delete any pending upload files from the agent home

rm -r $AGENT_HOME/sysman/emd/state/*

rm -r $AGENT_HOME/sysman/emd/upload/*

rm $AGENT_HOME/sysman/emd/lastupld.xml

rm $AGENT_HOME/sysman/emd/agntstmp.txt

rm $AGENT_HOME/sysman/emd/protocol.ini

Start the agent

$AGENT_HOME/bin/emctl start agent

Issue an agent clearstate from the agent home

$AGENT_HOME/bin/emctl clearstate agent

Force an upload to the OMS

$AGENT_HOME/bin/emctl upload agent

Finally I sometimes need to re-secure the agent

$AGENT_HOME/bin/emctl secure agent

Posted in Grid control and agents, Oracle | Tagged: , , , , | Leave a Comment »