Tuesday, May 8, 2012

Manually configure the Oracle 10g & 11g EM dbconsole


Overview
When you choose to create a preconfigured database during the Oracle 10g installation, you can select the Oracle Enterprise Manager (OEM) interface that you want to use to manage the database. The following options are available:
  • Database Grid Control
This option is available only if an Oracle Management Agent is installed on the system. When the Installer detects an Oracle Management Agent on the system, it allows you to choose this option and specify the Oracle Management Service that you want to use to manage the database.
If an Oracle Management Agent is not installed, you must choose to use Database Control to manage the database. However, if you install Oracle Management Agent after you install Oracle Database, you can then use Grid Control to manage this database.
  • Database Control
This option is selected by default if an Oracle Management Agent is not installed on the system. However, even if a Management Agent is installed, you can still choose to configure Database Control to manage the database.
Custom installation
If you choose the Custom installation type or the Advanced database configuration option during the installation, the Installer does not display the OEM setup screens. Instead, it runs the Database Configuration Assistant (DBCA) in interactive mode, which enables you to create a custom database.
DBCA also enables you to specify the Oracle Enterprise Manager interface that you want to use. Furthermore, you can also use DBCA after the installation to configure Database Control for a database that was not previously configured to use it.
However, if you decide to setup your own Database, you must install the Database Control manually.
Setup your own Database and manually install the Database Control
The Database Control relies on various underlying technologies to discover, monitor, and administer the Oracle Database environment.
From the Database Control, you can monitor and administer a single Oracle Database instance.
The Database Control Framework consists of the Database Control and its underlying technologies:
  • A local version of the Oracle Management Service designed to work with the local database or clustered database.
     
  • A local Oracle Management Repository installed in the local database and designed to store management data for the Database Control.
The following steps have to be performed.
Create your own Database
More information to setup your own Database can be found here:
Create the Database Control Repository and setup the OC4J Application Server
Make sure, that you can connect to the Repository Database (Test it with SQL*Plus). Examples for Setup Files can be found here:
Windows
Linux
LISTENER.ORAlistener.ora
SQLNET.ORAsqlnet.ora
TNSNAMES.ORAtnsnames.ora
Now start the Oracle EM dbconsole Build Script ($ORACLE_HOME/bin/emca for Linux and $ORACLE_HOME\Bin\emca.bat for Windows).
$ emca -repos create
$ emca -config dbcontrol db
STARTED EMCA at Fri May 14 10:43:22 MEST 2004
Enter the following information about the database
to be configured.


Listener port number: 1521
Database SID:
 AKI1
Service name:
 AKI1.WORLD
Email address for notification:
 martin dot zahn at akadia dot ch
Email gateway for notification:
 mailhost
Password for dbsnmp:
 xxxxxxx
Password for sysman:
 xxxxxxx
Password for sys:
 xxxxxxx
---------------------------------------------------------
You have specified the following settings

Database ORACLE_HOME: /opt/oracle/product/10.1.0
Enterprise Manager ORACLE_HOME: /opt/oracle/product/10.1.0

Database host name ..........: akira
Listener port number .........: 1521
Database SID .................: AKI1
Service name .................: AKI1
Email address for notification: martin dot zahn at akadia dot ch
Email gateway for notification: mailhost
---------------------------------------------------------
Do you wish to continue? [yes/no]: yes
AM oracle.sysman.emcp.EMConfig updateReposVars
INFO: Updating file ../config/repository.variables ...
Now wait about 10 Minutes to complete!
M oracle.sysman.emcp.EMConfig createRepository
INFO: Creating repository ...
M oracle.sysman.emcp.EMConfig perform
INFO: Repository was created successfully
M oracle.sysman.emcp.util.PortQuery findUsedPorts
INFO: Searching services file for used port
AM oracle.sysman.emcp.EMConfig getProperties
...........
...........
INFO: Starting the DBConsole ...
AM oracle.sysman.emcp.EMConfig perform
INFO: DBConsole is started successfully
INFO: >>>>>>>>>>> The Enterprise Manager URL ishttp://akira:5500/em <<<<<<<<<<<
Enterprise Manager configuration is completed successfully
FINISHED EMCA at Fri May 14 10:55:25 MEST 2004
Try to connect to the database Control
http://akira:5500/em



How to manually start Oracle Enterprise Manager 11g Database Control



Issue =
 How to manually start Oracle Enterprise Manager 11g Database Control

Environment = Oracle Enterprise Linux 5.7, Oracle DB 11g (11.2.0.2), Oracle Enterprise Manager 11g Database Control Release 11.2.0.1.0
Resolution = Follow the below mentioned steps

Step 1 - Login as Oracle user and go to $ORACLE_HOME/bin
$ su - oracle
$ cd $ORACLE_HOME/bin

Step 2 - Start Listener
$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 01-APR-2012 15:34:29
Copyright (c) 1991, 2009, Oracle.  All rights reserved.
Starting /u01/app/oracle/product/11.2.0.2/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/11.2.0.2/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/FUSIONINST/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=FUSIONINST.aclnz.com)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                01-APR-2012 15:34:31
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0.2/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/FUSIONINST/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=FUSIONINST.aclnz.com)(PORT=1521)))
The listener supports no services
The command completed successfully
Step 3 - Start Database
$ sqlplus '/ as sysdba';
SQL*Plus: Release 11.2.0.1.0 Production on Sun Apr 1 15:33:08 2012
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> startup;
ORACLE instance started.
Total System Global Area 3273736192 bytes
Fixed Size                  2241184 bytes
Variable Size             805309792 bytes
Database Buffers         2462056448 bytes
Redo Buffers                4128768 bytes
Database mounted.
Database opened.
SQL> exit
Step 4 - Start Oracle Enterprise Manager 11g Database Control Release 11.2.0.1.0
$ ./emctl start dbconsole


Oracle Enterprise Manager 11g Database Control Release 11.2.0.1.0
Copyright (c) 1996, 2009 Oracle Corporation.  All rights reserved.
https://FUSIONINST:1158/em/console/aboutApplication
Starting Oracle Enterprise Manager 11g Database Control ........ started.
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/11.2.0.2/db_1/FUSIONINST_FUSION/sysman/log





Steps to configure Oracle 11g OEM DBConsole manually for an existing database

1 Comment

In most of the time DBAs used to go for manual configuration of the database after the database creation. Suppose your database is cloned from other database where you have grid already installed and configured. After the cloning, in the target database the same set of configuration will not work. You have to reconfigure the same. For that you have to drop the existing configuration first. If it is a new database you can directly configure the grid using emca.
Step 1. Drop the existing configuration if it is having sysman user already present.
Connect to sqlplus with sys as sysdba and check SYSMAN is exist or not
SQL> Select username from dba_users where username='SYSMAN';

USERNAME
------------------------------
SYSMAN
      
Command to drop the existing configuration
$ emca -deconfig dbcontrol db -repos drop

STARTED EMCA at Jun 23, 2011 5:27:34 AM
EM Configuration Assistant, Version 11.1.0.7.0 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.

Enter the following information:
Database SID: prod9
Listener port number: 1522
Password for SYS user:
Password for SYSMAN user:
Password for SYSMAN user:
Do you wish to continue? [yes(Y)/no(N)]: Y
Jun 23, 2011 5:27:47 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /data/oracle/cfgtoollogs/emca/prod9/emca_2011_06_23_05_27_34.log.
Jun 23, 2011 5:27:49 AM oracle.sysman.emcp.EMDBPreConfig performDeconfiguration
WARNING: EM is not configured for this database. No EM-specific actions can be performed.
Jun 23, 2011 5:27:50 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Jun 23, 2011 5:37:25 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Enterprise Manager configuration completed successfully
FINISHED EMCA at Jun 23, 2011 5:37:26 AM

Step 2. Create the OEM GRID repository
$ emca -repos create

STARTED EMCA at Jun 23, 2011 6:41:59 AM
EM Configuration Assistant, Version 11.1.0.7.0 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.

Enter the following information:
Database SID: prod9
Listener port number: 1522
Password for SYS user:
Password for SYSMAN user:
Do you wish to continue? [yes(Y)/no(N)]: Y
Jun 23, 2011 6:42:17 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /data/oracle/cfgtoollogs/emca/prod9/emca_2011_06_23_06_41_59.log.
Jun 23, 2011 6:42:18 AM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Jun 23, 2011 7:16:31 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Enterprise Manager configuration completed successfully
FINISHED EMCA at Jun 23, 2011 7:16:31 AM

Step 4. Confitgure EM Grid control

$ emca -config dbcontrol db

STARTED EMCA at Jun 23, 2011 8:58:47 PM
EM Configuration Assistant, Version 11.1.0.7.0 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.

Enter the following information:
Database SID: prod9
Database Control is already configured for the database prod9
You have chosen to configure Database Control for managing the database prod9
This will remove the existing configuration and the default settings and perform a fresh configuration
Do you wish to continue? [yes(Y)/no(N)]: Y
Listener port number: 1522
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
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 ................ /data/oracle/product/11.1.0

Local hostname ................ localhost
Listener port number ................ 1522
Database SID ................ prod9
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............

-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: y
Jun 23, 2011 8:59:36 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /data/oracle/cfgtoollogs/emca/prod9/emca_2011_06_23_20_58_47.log.
Jun 23, 2011 8:59:41 PM oracle.sysman.emcp.util.DBControlUtil stopOMS
INFO: Stopping Database Control (this may take a while) ...
Jun 23, 2011 8:59:49 PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
Jun 23, 2011 9:09:13 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Jun 23, 2011 9:09:36 PM oracle.sysman.emcp.util.DBControlUtil configureSoftwareLib
INFO: Software library configured successfully.
Jun 23, 2011 9:09:36 PM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Deploying Provisioning archives ...
Jun 23, 2011 9:10:15 PM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Provisioning archives deployed successfully.
Jun 23, 2011 9:10:16 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Jun 23, 2011 9:11:01 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
Jun 23, 2011 9:11:01 PM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Jun 23, 2011 9:13:04 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Jun 23, 2011 9:13:04 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://localhost:1158/em <<<<<<<
Jun 23, 2011 9:13:20 PM oracle.sysman.emcp.EMDBPostConfig invoke
WARNING:
************************  WARNING  ************************

Management Repository has been placed in secure mode wherein Enterprise Manager data will be encrypte                                                    ile: /data/oracle/product/11.1.0/localhost_prod9/sysman/config/emkey.ora.   Pleas                                                         d data will become unusable if this file is lost.
***********************************************************
Enterprise Manager configuration completed successfully
FINISHED EMCA at Jun 23, 2011 9:13:20 PM

Step 5. Verify the configuration by typing the address (https://localhost:1158/em) in the explorer.

2 comments:

  1. getting below error during creating dbconsole

    C:\Users\JESUS>emca -repos create
    paramName:repos
    paramValue:create
    Could not find listener running from crs home.
    PRCR-1173 : Failed to look up CRS resource for type ora.listener.type
    PRCR-1068 : Failed to query resources
    CRS-0184 :
    at oracle.cluster.impl.nodeapps.NodeAppsFactoryImpl.getListeners(NodeAppsFactoryImpl.java:1969)

    at oracle.cluster.nodeapps.NodeAppsFactory.getListeners(NodeAppsFactory.java:2119)
    at oracle.sysman.assistants.emca.sdkimpl.EMConfigAssistant.setParameters(EMConfigAssistant.java
    :402)
    at oracle.sysman.assistants.emca.sdkimpl.EMConfigAssistant.statusMain(EMConfigAssistant.java:93
    )
    at oracle.sysman.assistants.emca.sdkimpl.EMConfigAssistant.main(EMConfigAssistant.java:86)
    Caused by: PRCR-1068 : Failed to query resources
    CRS-0184 :
    at oracle.cluster.impl.crs.cops.CRSNative.internalQueryResources(CRSNative.java:1060)
    at oracle.cluster.impl.crs.cops.CRSNative.queryResources(CRSNative.java:425)
    at oracle.cluster.impl.crs.CRSFactoryImpl.searchResources(CRSFactoryImpl.java:1282)
    at oracle.cluster.impl.nodeapps.NodeAppsFactoryImpl.getListeners(NodeAppsFactoryImpl.java:1935)

    ... 4 more
    Caused by: CRS-0184 :
    at oracle.cluster.impl.crs.cops.CRSNativeResult.createException(CRSNativeResult.java:542)
    at oracle.cluster.impl.crs.cops.CRSNative.doQueryResources(Native Method)
    at oracle.cluster.impl.crs.cops.CRSNative.internalQueryResources(CRSNative.java:1045)
    ... 7 more
    Caused by: oracle.cluster.crs.CRSConnectionException
    at oracle.cluster.impl.crs.cops.CRSNativeException.(CRSNativeException.java:52)
    ... 10 more
    Failed to update Enterprise Manager: null
    oracle.sysman.assistants.emca.exception.DbTargetException: Failed to update Enterprise Manager: null
    at oracle.sysman.assistants.emca.sdkimpl.DbTargetManagerImpl.perform(DbTargetManagerImpl.java:3
    616)
    at oracle.sysman.assistants.emca.sdkimpl.EMConfigAssistant.invokeEMCA(EMConfigAssistant.java:10
    6)
    at oracle.sysman.assistants.emca.sdkimpl.EMConfigAssistant.setParameters(EMConfigAssistant.java
    :463)
    at oracle.sysman.assistants.emca.sdkimpl.EMConfigAssistant.statusMain(EMConfigAssistant.java:93
    )
    at oracle.sysman.assistants.emca.sdkimpl.EMConfigAssistant.main(EMConfigAssistant.java:86)

    I am running in single instance database anyone help me how to resolve this ? thanks in advance.....

    ReplyDelete