Monday, April 14, 2008

An Stack of Problems while creating Repository using emca

In my database I tried to create repository and stopped several times while creating repository. I spend a significant amount of time to create repository and after analysis I got the following.

A)Manually Resolve
1)If you fail after invoking command
emca -config dbcontrol db -repos create see alert log file for more details. Also refer to another log file if it shows. Directly go to step 3)

2)However I see many errors like,
CONFIG: ORA-00955: name is already used by an existing object
CONFIG: ORA-01921: role name 'MGMT_USER' conflicts with another user or role name
and many severals errors.

3)Execute the following commands in SQL*plus and then execute emca command. I wish no more error will come. After several experiment I get this.



drop user sysman cascade;
drop public synonym SETEMVIEWUSERCONTEXT;
drop role MGMT_USER;
drop PUBLIC SYNONYM MGMT_TARGET_BLACKOUTS;
drop user MGMT_VIEW;

And then,

$ emca -deconfig dbcontrol db
$ emca -config dbcontrol db -repos create


B)Using RepManager:
If I drop the Repository using RepManager like following error will not come while creating repository.
$ORACLE_HOME/sysman/admin/emdrep/bin/RepManager -action drop

This will not remove the configuration files, but only the repository related objects from the database.

But you need to remember when RepManager is ran the database will be put in Quiescing mode.

8 comments:

  1. Woohoo !

    Worked for me :)

    ReplyDelete
  2. Ngoc Phu try to use IP instead of hostname. In most cases it works.

    ReplyDelete
  3. Thanks Mohammad - this worked great for me as well. I had additional problems but got them resolved also. Much appreciated.

    ReplyDelete
  4. select 'drop public synonym '||synonym_name||';' from dba_synonyms where table_owner = 'SYSMAN';

    dropping the user with cascade, does not drop the public synonyms, and depending upon where you get stopped, there could be hundreds created already. The above will allow you to create a script to drop the rest.

    The steps you provided helped me great (to get on to the next errors).

    thanks

    ReplyDelete
  5. all is needed is to use recreate instead of create:

    instead of emca -config dbcontrol db -repos create

    ReplyDelete
  6. You are simply great man..hats off..!!

    I had spent almost 2 days in fixing this problem..
    but just dropped the objects you specified...

    and it started working..!!! voila!!

    THANKS A LOTTTTTTTTTTTTTT !!!!

    ReplyDelete
  7. Using these 2 commands worked for me and I was able to see the dbconsole.

    $ emca -deconfig dbcontrol db
    $ emca -config dbcontrol db -repos create

    Thanks!

    ReplyDelete
  8. Thanks a lot dude, it was a nightmare for me, finally I found your site where you have give addtional steps besides 2 golden commands.

    ReplyDelete