Very rarely you can encounter this problem in enterprise manager – a host or agent target that you cannot remove via the web interface. This is usually caused in my environment by decommissioning a host BEFORE the targets have all been dropped (Basically being a gungho dumbass and not considering things properly).
You can do a lot of operations by the emcli command line interface from your enterprise manager host
Login to Enterprise Manager
-bash-4.1$ ./emcli login -username=SYSMAN Enter password : Login successful
Run the sync command to synchronize with the current OMS
-bash-4.1$ ./emcli sync Synchronized successfully
Get the target that you want to remove – in my case it is a zone host that has been trashed.
-bash-4.1$ ./emcli get_targets |grep ssca-z7 4 Agent Unreachab host ssca-z7-mgmt.osc.uk.oracle.com 4 Agent Unreachab oracle_emd ssca-z7-mgmt.osc.uk.oracle.com:3872
I need to remove both the agent and the host
-bash-4.1$ ./emcli delete_target -name="ssca-z7-mgmt.osc.uk.oracle.com:3872" -type="oracle_emd" -delete_monitored_target
And then you can login to the GUI and check that it has gone!