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.

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

Anonymous said...

Thanks for the info.. it worked for me....

When i tried to test the mail by test mail servers i am getting this error
Sending failed; nested exception is: javax.mail.MessagingException: 530 5.7.0 Must issue a STARTTLS command

Please let me know ...

Sandy

Mangesh Gokhale said...

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!

Anonymous said...

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.

Robert said...

So I did a fresh install of Oracle 11g on Oracle Enterprise Linux yesterday. It all went fine, installed started DB at the same time. The web console was started automatically by installer. After rebooting, I get the error: "OC4J Configuration issue." when invoking "emctl start dbconsole". I can connect to the database using sqlplus, and Oracle SQL Developer, but the web-console is a no-show. I found this post from another referring post at:
http://www.orafaq.com/forum/t/101272/0/

Seems strange that the installer was able to get the web console up, but not after restarting the system.

Robert said...

So it appeared that your suggestion would work, but when re-creating the repo, I got YOEM (yet another error message)
SEVERE: Error creating the repository

Robert said...

Refer to the log file at /u01/app/oracle/product/cfgtoollogs/emca/orcl/emca_2010_01_29_21_48_48.log for more details.
Could not complete the configuration. Refer to the log file at /u01/app/oracle/product/cfgtoollogs/emca/orcl/emca_2010_01_29_21_48_48.log for more deta
Of course when I go to that directory, that log file does not exist.

Arju said...

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

Robert said...

Well, that almost worked. It ran much longer this time - several minutes but failed with this in the log:

CREATE PUBLIC SYNONYM MGMT_AVAILABILITY FOR MGMT_AVAILABILITY
*
ERROR at line 1:
ORA-00955: name is already used by an existing object

I'll try dropping that as well and running it again.

Robert said...

Ok, finally got this working. The amount of drops was huge, so I won't post them here. I found someone who had the same problem as I did, and his post can be found at:
http://forums.oracle.com/forums/thread.jspa?threadID=946742

Secondly, I ran into what is a posted bug on 11g:

From the 11gR2 README file (under Open Bugs):
/*

Bug 8638267
If you select the "Desktop Class" style database configuration in the Installer, and after completing the installation you attempt to create a database using DBCA or any DBControl setup using Enterprise Manager Configuration Assistant (EMCA), then you must set the ORACLE_HOSTNAME environment variable to 'localhost'. If you do not set ORACLE_HOSTNAME, then DBCA fails while configuring Enterprise Manager with the following error:
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.

Workaround: Set the ORACLE_HOSTNAME environment variable to 'localhost' and retry creating the database.
====
So running the big 'drop' script and fixing ORACLE_HOSTNAME got me up and running.

Your post did get me at least on the right path - thanks!

elspy007 said...

It works! :D

Option (A) success!