I was given the task to remove the target host/agents and other listed targets of Server1 from Oracle grid control. At first I thought it was very easy and I was definitely correct. Here’s what happened:
From OEM Grid Control I clicked on targets and selected the Server1 from the list. Then from its homepage I clicked on the the targets and then I eventually select all the targets except of course from the agent. Note: (the management agent of server1 must be running to do this). The targets were successfully deleted and now the only thing left is the host and the agent of Server1.
To remove the agent and host form the list, I stop the management agent of server1 then I went back to my OEM Grid control to remove the host Server1. Now there comes the challenge, No matter how many times I tried to delete the host Server1 from oem grid control It seems like the page is just running and nothing happens. No matter how long I’ve waited the host Server1 still remains on the list.
Now to clean it manually, I connect to the OEM Grid Repository and perform the following:
SQL> select target_name from mgmt_targets where target_type=’oracle_emd';
This command show me the list of all the registered targets from my OEM and I can see that Server1 is still there. Then to manually remove Server1 from the list, I then execute:
SQL> exec mgmt_admin.cleanup_agent(‘Server1:3872′);
It will take a while at least 3 to 5 mins the most. Once it was completed I quickly checked my OEM Grid Control Target List and voila!!! Server1 was successfully removed from the target list together with its agent.Thanks to Metalink Note:454081.1 and to Luis Cardenas post (http://www.lazydba.com/oracle/0__146127.html) who gave me the idea to solve my problem.