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