Thursday, May 1, 2014

Manually adding a database target to 12c EM fails with ORA-20500

Problem:
Getting the following error when trying to manually add a target database to 12c Grid Control:

oracle.sysman.emSDK.core.target.DuplicateEntityException: ORA-20500: ORCL.WORLD:oracle_database:myhost.domain.com:https://myhost.domain.com:3872/emd/main/:3:0 ORA-06512: at "SYSMAN.EM_TARGET", line 3347 ORA-06512: at line 1 - ORA-20500: ORCL.WORLD:oracle_database:myhost.domain.com:https://myhost.domain.com:3872/emd/main/:3:0 ORA-06512: at "SYSMAN.EM_TARGET", line 3347 ORA-06512: at line 1

Solution:
To fix this error we need to delete database target from the OEM repository.  

Connect to the repository database as sysman user and run the following sql statement:
--Upper Case
exec mgmt_admin.delete_target('DB_NAME','oracle_database');

--Lower Case
exec mgmt_admin.delete_target('db_name','oracle_database');


Run this sql statement against OEM repository:
--Should return zero rows
select TARGET_NAME, TARGET_TYPE, DISPLAY_NAME
from sysman.mgmt_targets
where target_type='oracle_database'
and target_name = 'DB_NAME';


I hope this helps.

Please feel free to leave your questions or suggest improvements to this section.

No comments:

Post a Comment