Tuesday, May 22, 2012

Oracle 10gR2:Reconfigure Data Control by EMCA



1.Set oracle parameter

Set oracle_sid=blogdb
Set Oracle_Home=F:\oracle\product\10.2.0\db_1

2.De configure and delete old entries.

emca -deconfig all db -repos drop




3.Configure Data Control.

emca -config all db -repos create

Output
May 22, 2012 12:07:44 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at F:\oracle\product\10.2.0\db_1\cfgtoollog
s\emca\blogdb\emca_2012-05-22_12-06-05-PM.log.
May 22, 2012 12:07:47 PM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
May 22, 2012 12:07:47 PM oracle.sysman.emcp.EMReposConfig invoke
SEVERE: Error creating the repository
May 22, 2012 12:07:47 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Refer to the log file at F:\oracle\product\10.2.0\db_1\cfgtoollogs\emca\bl
ogdb\emca_repos_create_<date>.log for more details.
May 22, 2012 12:07:47 PM oracle.sysman.emcp.EMConfig perform
SEVERE: Error creating the repository
Refer to the log file at F:\oracle\product\10.2.0\db_1\cfgtoollogs\emca\blogdb\e
mca_2012-05-22_12-06-05-PM.log for more details.
Could not complete the configuration. Refer to the log file at F:\oracle\product
\10.2.0\db_1\cfgtoollogs\emca\blogdb\emca_2012-05-22_12-06-05-PM.log for more de
tails.


in log

CONFIG: ORA-20001: SYSMAN already exists..
ORA-06512: at line 17

oracle.sysman.assistants.util.sqlEngine.SQLFatalErrorException: ORA-20001: SYSMAN already exists..
ORA-06512: at line 17


    at oracle.sysman.assistants.util.sqlEngine.SQLEngine.executeImpl(SQLEngine.java:1467)
    at oracle.sysman.assistants.util.sqlEngine.SQLEngine.executeScript(SQLEngine.java:841)
    at oracle.sysman.assistants.util.sqlEngine.SQLPlusEngine.executeScript(SQLPlusEngine.java:265)
    at oracle.sysman.assistants.util.sqlEngine.SQLPlusEngine.executeScript(SQLPlusEngine.java:306)
    at oracle.sysman.emcp.EMReposConfig.createRepository(EMReposConfig.java:360)
    at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:182)
    at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:124)
    at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:142)
    at oracle.sysman.emcp.EMConfigAssistant.invokeEMCA(EMConfigAssistant.java:479)
    at oracle.sysman.emcp.EMConfigAssistant.performConfiguration(EMConfigAssistant.java:1123)
    at oracle.sysman.emcp.EMConfigAssistant.statusMain(EMConfigAssistant.java:463)
    at oracle.sysman.emcp.EMConfigAssistant.main(EMConfigAssistant.java:412)
May 22, 2012 12:07:47 PM oracle.sysman.emcp.EMReposConfig invoke


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:1467)
    at oracle.sysman.assistants.util.sqlEngine.SQLEngine.executeScript(SQLEngine.java:841)
    at oracle.sysman.assistants.util.sqlEngine.SQLPlusEngine.executeScript(SQLPlusEngine.java:265)
    at oracle.sysman.assistants.util.sqlEngine.SQLPlusEngine.executeScript(SQLPlusEngine.java:306)
    at oracle.sysman.emcp.EMReposConfig.createRepository(EMReposConfig.java:360)
    at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:182)
    at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:124)
    at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:142)
    at oracle.sysman.emcp.EMConfigAssistant.invokeEMCA(EMConfigAssistant.java:479)
    at oracle.sysman.emcp.EMConfigAssistant.performConfiguration(EMConfigAssistant.java:1123)
    at oracle.sysman.emcp.EMConfigAssistant.statusMain(EMConfigAssistant.java:463)
    at oracle.sysman.emcp.EMConfigAssistant.main(EMConfigAssistant.java:412)
May 22, 2012 12:14:08 PM oracle.sysman.emcp.EMReposConfig invoke
SEVERE: Error creating the repository


Solution. 

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;
       

User dropped.

SQL>



Again,issue command

emca -deconfig all db -repos drop 


 4.Start Configure it.it will take time.

Check Successful Message



Restart Services.

Start DB Console.