emca -config dbcontrol db -repos create / recreate
Nov 1, 2010 10:53:06 AM oracle.sysman.emcp.EMReposConfig createRepository
CONFIG: ORA-01921: role name 'MGMT_USER' conflicts with another user or role name
oracle.sysman.assistants.util.sqlEngine.SQLFatalErrorException: ORA-01921: role name 'MGMT_USER' conflicts with another user or role name
at oracle.sysman.assistants.util.sqlEngine.SQLEngine.executeImpl(SQLEngine.java:1650)
at oracle.sysman.assistants.util.sqlEngine.SQLEngine.executeScript(SQLEngine.java:1000)
at oracle.sysman.assistants.util.sqlEngine.SQLPlusEngine.executeScript(SQLPlusEngine.java:339)
at oracle.sysman.assistants.util.sqlEngine.SQLPlusEngine.executeScript(SQLPlusEngine.java:380)
at oracle.sysman.emcp.EMReposConfig.createRepository(EMReposConfig.java:510)
at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:228)
at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:157)
at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:253)
at oracle.sysman.emcp.EMConfigAssistant.invokeEMCA(EMConfigAssistant.java:589)
at oracle.sysman.emcp.EMConfigAssistant.performConfiguration(EMConfigAssistant.java:1448)
at oracle.sysman.emcp.EMConfigAssistant.statusMain(EMConfigAssistant.java:573)
at oracle.sysman.emcp.EMConfigAssistant.main(EMConfigAssistant.java:521)
Nov 1, 2010 10:53:06 AM oracle.sysman.emcp.EMReposConfig invoke
SEVERE: Error creating the repository
===the steps if create fail ===========
SELECT grantee, granted_role FROM dba_role_privs WHERE granted_role = 'MGMT_USER';
drop role mgmt_user;
drop user sysman cascade;
DROP USER SYSMAN CASCADE;
DROP USER MGMT_VIEW CASCADE;
SET HEADING OFF;
spool a.sql
SELECT 'DROP PUBLIC SYNONYM ' || SYNONYM_NAME || ';'
FROM ALL_SYNONYMS
WHERE OWNER = 'PUBLIC' AND TABLE_OWNER ='SYSMAN';
spool off
SET HEADING ON;
@a.sql
CONFIG: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
oracle.sysman.assistants.util.sqlEngine.SQLFatalErrorException: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
at oracle.sysman.assistants.util.sqlEngine.SQLEngine.executeImpl(SQLEngine.java:1650)
at oracle.sysman.assistants.util.sqlEngine.SQLEngine.executeSql(SQLEngine.java:1898)
at oracle.sysman.emcp.ParamsManager.checkListenerStatusForDBControl(ParamsManager.java:3230)
at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:203)
at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:157)
at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:253)
at oracle.sysman.emcp.EMConfigAssistant.invokeEMCA(EMConfigAssistant.java:589)
at oracle.sysman.emcp.EMConfigAssistant.performConfiguration(EMConfigAssistant.java:1448)
at oracle.sysman.emcp.EMConfigAssistant.statusMain(EMConfigAssistant.java:573)
at oracle.sysman.emcp.EMConfigAssistant.main(EMConfigAssistant.java:521)
Nov 1, 2010 11:22:04 AM oracle.sysman.emcp.EMConfig perform
SEVERE: Listener is not up or database service is not registered with it. Start the Listener and register database service and run EM Configuration Assistant again .
How to Recreate the Database Control Repository - (Oracle10g R2)
http://www.idevelopment.info/data/Oracle/DBA_tips/Oracle_Enterprise_Manager/OEM_4.shtml