How to remove a deleted agent from the GRID Control repository database?

5 08 2008
Howto: How to remove a deleted agent from the GRID Control repository database?
Doc ID: Note:454081.1 Type: HOWTO
Last Revision Date: 24-OCT-2007 Status: PUBLISHED
In this Document
Goal
Solution
References


Applies to:

Enterprise Manager Grid Control – Version: 10.2.0.1 to 10.2.0.4
Information in this document applies to any platform.

Goal

The targets are removed from Grid Control UI.  However, it seems it was not completely removed.  The repository still has reference to the removed Agent. Agent was not totally removed from the repository.

How do you remove the deleted agent from the repository?

Solution

1. Please ensure that the agent is stopped.

2. Logon with sqlplus against the repository database as user sysman
and run following command:

exec mgmt_admin.cleanup_agent('<myserver>:<port>');

3. If this program are deleting anything end with submit

4. If the procedure find something to delete you can now start the agent again.

5. If this procedure doesn’t find anything for delete

5.1 Edit the agent agent side edit the $ORACLE_HOME/sysman/config/emd.properties
Change the port number in:
EMD_URL=https://server:port/emd/main/
to the next free port at this node

5.2 Save the emd.properties

5.3 Confirm that the Agent home $ORACLE_HOME/sysman/emd/targets.xml file has the new port number defined for the emd agent.

5.4 Start the agent.

The agent will be now added with the new port number.

It is strongly suggest always to use the procedure
exec mgmt_admin.cleanup_agent(‘<myserver>:<port>’);
to remove entire host targets from the Grid Control.
This avoid that anything not deleted correctly