I blogged about how to remove targets from OEM <a href=”http://jhdba.wordpress.com/2009/01/07/removing-a-grid-target-from-the-oms/”> removing a Grid target </a> and I used my own blog entry yesterday to try and force the removal of several entries. These appeared to work but when I tried adding new targets (we were migrating databases fom one server to another) I got the error message
java.sql.SQLException: ORA-20600: The specified target is in the process of being deleted.(target name = SID)(target type = oracle_database)(target guid = 21D8EFD67CCF409D7CDB41DCFD1F9D94) ORA-06512: at “SYSMAN.TARGETS_INSERT_TRIGGER”, line 36 ORA-04088: error during execution of trigger ‘SYSMAN.TARGETS_INSERT_TRIGGER’ ORA-06512: at “SYSMAN.EM_TARGET”, line 1918 ORA-06512: at “SYSMAN.MGMT_TARGET”, line 2705 ORA-06512: at line 1A colleague, Allan Ho, looked at the problem and resolved it by looking in sysman.mgmt_targets_delete
select * from mgmt_targets_delete;To delete the entry use :
begin mgmt_admin.delete_target('SID','oracle_database'); end;You can also force deletion by using :
begin mgmt_admin.delete_target_internal('SID','oracle_database'); end;The dynamic sql would be
select 'execute sysman.mgmt_admin.delete_target_internal ('''||target_name||''','''||target_type||'''); ' from sysman.mgmt_targets_delete;