Experience: is what you get soon after you need it.

Experience: is what you get soon after you need it.

Rasul Allah (sal Allahu alaihi wa sallam) said: "Restore the trusts of those who trust you, and deal not falsely with him who deals falsely with you." [Abu Dawud, Tirmidhi]

Search This Blog

Tuesday, August 11, 2015

ORA-01921: role name 'MGMT_USER' conflicts with another user or role name

While creating grid control repository manually I ran into the below issue:


[oracle@collabn2 admin]$ emca -config dbcontrol db -repos create

STARTED EMCA at Aug 6, 2015 8:33:27 PM
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.

Enter the following information:
Database SID: PROD2
Listener port number: 1621
Listener ORACLE_HOME [ /u01/app/oracle/product/11.2.0.2/SHAIKPROD ]:
Password for SYS user:  
Password for DBSNMP user:  
Password for SYSMAN user:  
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
-----------------------------------------------------------------

You have specified the following settings

Database ORACLE_HOME ................ /u01/app/oracle/product/11.2.0.2/SHAIKPROD

Local hostname ................ collabn2.shaiksameer

Listener ORACLE_HOME ................ /u01/app/oracle/product/11.2.0.2/SHAIKPROD

Listener port number ................ 1621

Database SID ................ PROD2

Email address for notifications ...............

Outgoing Mail (SMTP) server for notifications ...............


-----------------------------------------------------------------

Do you wish to continue? [yes(Y)/no(N)]: y
Aug 6, 2015 8:48:08 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/PROD2/emca_2015_08_06_20_47_52.log.
Aug 6, 2015 8:48:08 PM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Aug 6, 2015 8:48:08 PM oracle.sysman.emcp.EMReposConfig invoke
SEVERE: Error creating the repository
Aug 6, 2015 8:48:08 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Refer to the log file at /u01/app/oracle/cfgtoollogs/emca/PROD2/emca_repos_create_<date>.log for more details.
Aug 6, 2015 8:48:08 PM oracle.sysman.emcp.EMConfig perform
SEVERE: Error creating the repository
Refer to the log file at /u01/app/oracle/cfgtoollogs/emca/PROD2/emca_2015_08_06_20_47_52.log for more details.
Could not complete the configuration. Refer to the log file at /u01/app/oracle/cfgtoollogs/emca/PROD2/emca_2015_08_06_20_47_52.log for more details.

vi /u01/app/oracle/cfgtoollogs/emca/PROD2/emca_2015_08_06_20_47_52.log
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)
Aug 6, 2015 8:48:08 PM oracle.sysman.emcp.EMReposConfig invoke

Fix:-



SQL> SELECT grantee, granted_role FROM dba_role_privs WHERE granted_role = 'MGMT_USER';

GRANTEE               GRANTED_ROLE
------------------------------ ------------------------------
SYS                  MGMT_USER
SYSTEM           MGMT_USER

SQL> drop user sysman cascade;
User dropped.

SQL>drop public synonym SETEMVIEWUSERCONTEXT;
Synonym dropped.

SQL>drop role MGMT_USER;
Role dropped.

SQL>drop PUBLIC SYNONYM MGMT_TARGET_BLACKOUTS;
Synonym dropped.

SQL>drop user MGMT_VIEW;drop user sysman cascade
User dropped.

No comments: