Oracle DBA – A lifelong learning experience

Forced remove of targets from OEM repository

Posted by John Hallas on April 8, 2009

I blogged about how to remove targets from OEM <a href=””&gt; 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-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 1 

A 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 :



 You can also force deletion by using :



The dynamic sql would be

 select 'execute sysman.mgmt_admin.delete_target_internal ('''||target_name||''','''||target_type||'''); ' from sysman.mgmt_targets_delete;

7 Responses to “Forced remove of targets from OEM repository”

  1. Siti said


    i’m having problem to force delete the target in grid control. So I was using your script – mgmt_admin.delete_target_internal(‘SID’,’oracle_database’); to force delete the target. upon running the above – i got the ORA-25128: No insert/update/delete on table with constraint disabled and validated. Do you have any work around that you can suggest?

    Thank you.

    • John Hallas said

      Without testing it out Siti it seems to me that the error message is self-explanatory. Why is the constraint disabled? What happens when you enable it?

  2. Mohammad said

    DO NOT use mgmt_admin.delete_target_internal unless instructed to do so (Based on bug update, etc…) This routine bypassed a number of checks which CAN create trouble.

  3. vkaminsky said

    Thank you again John – I had 10 min to get rid of agent deleted at host and your blog saved me….

  4. mamta said

    yes, it saved me too! thanks!!

  5. Its been alleged that a target is deleted by my team in OEM. To prove it FALSE i queried sysman.mgmt_targets_delete. but the data i see is of last 4 days only. but the target was deleted say ~ 45 days before.

    Is there a view / way in OEM to get to know when any OEM target is deleted ??

    Thanks !!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: