Skip to content
April 30, 2012 / doganay

HOW TO CLEANUP GRID CONTROL AGENT

, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
--to cleanup agent
exec sysman.mgmt_admin.cleanup_agent('hostname:port');

If you get this error:

*
ERROR at line 1:
ORA-20206: Target does not exist:
ORA-06512: at "SYSMAN.MGMT_ADMIN", line 630
ORA-06512: at "SYSMAN.MGMT_ADMIN", line 417
ORA-06512: at "SYSMAN.MGMT_ADMIN", line 1188
ORA-06512: at line 1

Try this one:

--code to delete 1 row
declare
v_target_name VARCHAR2(256);
v_target_type VARCHAR2(64);
v_entry_name VARCHAR2(256);
begin
--type target name that you want to delete
v_entry_name:='LISTENER_MYDB_myhost';
--type target type that you want to delete
v_target_type:='oracle_listener';
select target_name, target_type into v_target_name, v_target_type from sysman.MGMT$TARGET where target_name=v_entry_name;
sysman.mgmt_admin.delete_target(v_target_name, v_target_type);
commit;
end;
/
Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: