Sunday, February 08, 2009

Setup Oracle Enterprise Manager 11G on Ubuntu

A couple of posts ago I explained how to setup a Oracle 11G database on Ubuntu Linux, after that I wanted to setup the Oracle Enterprise Manager 11G for Database Controle on Ubuntu Linux. For some reason the first attempt was not successful which helped me to find some error messages and learn how to debug those kind of problems.

To install the Oracle Enterprise Manager (OEM) for you 11G database on the database server you have to take basilcy the following steps:

Login as the user Oracle and make sure that you database is running and that the environmental variables are set, ORACLE_HOME, ORACLE_SID are the most important. To check this you can do a "env | grep ORACLE" which should give you a result something like this:


oracle@orcl11gdb:/u01$ env | grep ORACLE
ORACLE_SID=JLO11G
ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1

Next, go to "$ORACLE_HOME/bin" and execute the command: emca -config dbcontrol db -repos create

My first attempt was blocked because of the fact that after my installation the user DBSNMP was disabled and because of the fact I entered a password incorrectly when I was asked to provide it. This resulted in a error message like the one below:

oracle.sysman.emcp.exception.EMConfigException: Error dropping the repository
at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:208)
at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:147)
at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:221)
at oracle.sysman.emcp.EMConfigAssistant.invokeEMCA(EMConfigAssistant.java:534)
at oracle.sysman.emcp.EMConfigAssistant.performConfiguration(EMConfigAssistant.java:1214)
at oracle.sysman.emcp.EMConfigAssistant.statusMain(EMConfigAssistant.java:518)
at oracle.sysman.emcp.EMConfigAssistant.main(EMConfigAssistant.java:467)

after correcting this error I tried the create command again and was able to have emca make a connection to the database however the following problem was that some parts of the script where somehow already executed. This resulted in a error like the one below:



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:1500)
at oracle.sysman.assistants.util.sqlEngine.SQLEngine.executeScript(SQLEngine.java:874)
at oracle.sysman.assistants.util.sqlEngine.SQLPlusEngine.executeScript(SQLPlusEngine.java:270)
at oracle.sysman.assistants.util.sqlEngine.SQLPlusEngine.executeScript(SQLPlusEngine.java:311)
at oracle.sysman.emcp.EMReposConfig.createRepository(EMReposConfig.java:492)
at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:218)
at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:147)
at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:221)
at oracle.sysman.emcp.EMConfigAssistant.invokeEMCA(EMConfigAssistant.java:534)
at oracle.sysman.emcp.EMConfigAssistant.performConfiguration(EMConfigAssistant.java:1214)
at oracle.sysman.emcp.EMConfigAssistant.statusMain(EMConfigAssistant.java:518)
at oracle.sysman.emcp.EMConfigAssistant.main(EMConfigAssistant.java:467)
Feb 7, 2009 7:03:07 PM oracle.sysman.emcp.EMReposConfig invoke
SEVERE: Error creating the repository
Feb 7, 2009 7:03:07 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Refer to the log file at /u01/app/oracle/cfgtoollogs/emca/JLO11G/emca_repos_create_.log for more details.
Feb 7, 2009 7:03:07 PM oracle.sysman.emcp.EMConfig perform
SEVERE: Error creating the repository
Refer to the log file at /u01/app/oracle/cfgtoollogs/emca/JLO11G/emca_2009_02_07_19_02_38.log for more details.
Feb 7, 2009 7:03:07 PM oracle.sysman.emcp.EMConfig perform
CONFIG: Stack Trace:
oracle.sysman.emcp.exception.EMConfigException: Error creating the repository
at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:230)
at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:147)
at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:221)
at oracle.sysman.emcp.EMConfigAssistant.invokeEMCA(EMConfigAssistant.java:534)
at oracle.sysman.emcp.EMConfigAssistant.performConfiguration(EMConfigAssistant.java:1214)
at oracle.sysman.emcp.EMConfigAssistant.statusMain(EMConfigAssistant.java:518)
at oracle.sysman.emcp.EMConfigAssistant.main(EMConfigAssistant.java:467)

To get this corrected you can do a couple of things. You can drop the repository manually by executing a repository drop emca -deconfig dbcontrol db -repos drop and a create again with emca -config dbcontrol db -repos create. However the two commands can also be bundled in one by executing a recreate which will handle the dropping of the repository and creating it again. This can be done with emca -config dbcontrol db -repos recreate

oracle@orcl11gdb:/u01/app/oracle/product/11.1.0/db_1/bin$ emca -config dbcontrol db -repos recreate

STARTED EMCA at Feb 7, 2009 7:07:49 PM
EM Configuration Assistant, Version 11.1.0.5.0 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.

Enter the following information:
Database SID: JLO11G
Listener port number: 1521
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.1.0/db_1

Local hostname ................ orcl11gdb
Listener port number ................ 1521
Database SID ................ JLO11G
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............

-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Feb 7, 2009 7:08:12 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/JLO11G/emca_2009_02_07_19_07_49.log.
Feb 7, 2009 7:08:14 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Feb 7, 2009 7:11:53 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Feb 7, 2009 7:11:54 PM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Feb 7, 2009 7:20:44 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Feb 7, 2009 7:20:52 PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
Feb 7, 2009 7:23:14 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Feb 7, 2009 7:23:16 PM oracle.sysman.emcp.ParamsManager getLocalListener
WARNING: Error retrieving listener for orcl11gdb
Feb 7, 2009 7:23:24 PM oracle.sysman.emcp.util.DBControlUtil configureSoftwareLib
INFO: Software library configured successfully.
Feb 7, 2009 7:23:24 PM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Deploying Provisioning archives ...
Feb 7, 2009 7:23:47 PM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Provisioning archives deployed successfully.
Feb 7, 2009 7:23:47 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Feb 7, 2009 7:24:23 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
Feb 7, 2009 7:24:23 PM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Feb 7, 2009 7:25:54 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Feb 7, 2009 7:25:55 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://orcl11gdb:1158/em <<<<<<<<<<<
Feb 7, 2009 7:26:05 PM oracle.sysman.emcp.EMDBPostConfig invoke
WARNING:
************************ WARNING ************************

Management Repository has been placed in secure mode wherein Enterprise Manager data will be encrypted. The encryption key has been placed in the file: /u01/app/oracle/product/11.1.0/db_1/orcl11gdb_JLO11G/sysman/config/emkey.ora. Please ensure this file is backed up as the encrypted data will become unusable if this file is lost.

***********************************************************
Enterprise Manager configuration completed successfully
FINISHED EMCA at Feb 7, 2009 7:26:05 PM
oracle@orcl11gdb:/u01/app/oracle/product/11.1.0/db_1/bin$

now you should be able to get to the login page by opening the URL https://orcl11gdb:1158/em . If you are in need to stop or start OEM by hand you can make use of emctl start dbconsole to start it and to stop it you can make use of emctl stop dbconsole

5 comments:

Anonymous said...

Very helpful, as usual working with Oracle installs trying to get enterprise manager to work on ubuntu I ran into the same issues, your post here got me working and saved me some time, so thanks!

Anonymous said...

Thanks. Very helpful indeed. I had similar issues but on XP. Your post helped.

Unknown said...

Many Thanks for sharing.
Really appriciate.

Anonymous said...

I am installing EM for Oracle 11g on Ubuntu 8.04.

I am trying the solution here. The first time I ran 'emca -config dbcontrol db -repos create', I was told that EM already installed (it was not available, as I tried) and asked if I wanted to reconfigure (or something like) it. I answered Y, and the first time run failed. I ran 'emca -deconfig dbcontrol db -repos drop', and I got an error "SEVERE: Database instance unavailable. Could not complete the configuration." If I ran 'emca -config dbcontrol db -repos create', I got the follows:

8-Mar-2010 12:34:35 PM oracle.sysman.emcp.EMReposConfig invoke
SEVERE: Error creating the repository
8-Mar-2010 12:34:35 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Refer to the log file at /u01/app/oracle/cfgtoollogs/emca/oraTest/emca_repos_create_.log for more details.
8-Mar-2010 12:34:35 PM oracle.sysman.emcp.EMConfig perform
SEVERE: Error creating the repository
Refer to the log file at /u01/app/oracle/cfgtoollogs/emca/oraTest/emca_2010_03_08_12_33_27.log for more details.
Could not complete the configuration.

It seems to me that when I drop the repository, there is an error of database instance unavailable, so I cannot clean up and I cannot install a new one. I tried to log on to the instance, it is available. So what is wrong here? Can anyone help me?

Thanks in advanced.

Anonymous said...

johan - thanks very much - I have exactly the same issue. How did you solve your issue of DBSNMP user being locked and entering the psw's incorrrectly ?

manu