Oracle DBA – A lifelong learning experience

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: