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.

9 comments:

mvanle said...

Woohoo !

Worked for me :)

Ngoc Phu said...

It's nearly worked for me :(
After I recreate the reposiroty, I can see the Enterprise Manager website on localhost. But when I log in by sys as sysdba, an error appear: "Database error: unknown host name .." I dont remember exactly .. So, what can I do next? Thanks a lots!

Arju said...

Invoke emctl status and see the url and use that url in the EM.

WillI'm said...

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

Anonymous said...

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

Anonymous said...

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

Anselmo Borges said...

Congratulations...
It's works....

=)

merav kedem said...

all is needed is to use recreate instead of create:

instead of emca -config dbcontrol db -repos create

Prasad Karlekar said...

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 !!!!