Starting and Stopping Oracle Enterprise Manager 11g Grid Control

This document will detail the steps required to stop and start Oracle Enterprise Manager 11g Grid Control and all its components. For information on installing Oracle Enterprise Manager 11g Grid Control see the post Install Oracle Enterprise Manager Grid Control 11gR1 on Linux.

In this document I will be making references to the OMS_HOME and AGENT_HOME. If you do not happen to know what those locations are you can find them in the /etc/oratab file.

[oracle@gc bin]$ grep -E 'oms|agent' /etc/oratab
*:/u02/app/oracle/product/weblogic/oms11g:N
*:/u02/app/oracle/product/weblogic/agent11g:N
[oracle@gc bin]$

So in this example the OMS_HOME would be /u02/app/oracle/product/weblogic/oms11g and AGENT_HOME would be /u02/app/oracle/product/weblogic/agent11g.

NOTE: The Oracle Enterprise Manger 11g Grid Control install process puts a script called gcstartup in /etc/init.d that will stop and start the Oracle Management Service and Agent on OS startup/shutdown. It does not start or stop the repository database. If you would like to stop the automated startup/shutdown of Grid Control services place comments in front of the OMS and AGENT home directories in the /etc/oratab file or remove the script /etc/init.d/gcstartup.

Stopping Oracle Enterprise Manager 11g Grid Control

Stop the Oracle Management Service

From the OMS_HOME directory run the following to stop the OMS and WebTier services.

OMS_HOME/bin/emctl stop oms –all

[oracle@gc ~]$ /u02/app/oracle/product/weblogic/oms11g/bin/emctl stop oms -all
Oracle Enterprise Manager 11g Release 1 Grid Control  
Copyright (c) 1996, 2010 Oracle Corporation.  All rights reserved.
Stopping WebTier...
WebTier Successfully Stopped
Stopping Oracle Management Server...
Oracle Management Server Successfully Stopped
Oracle Management Server is Down
[oracle@gc ~]$

Note if you do not include the –all flag the HTTP services for the WebLogic Server will not be shutdown.

Stop the Oracle Management Agent

From the AGENT_HOME directory run the following to stop the Agent.

AGENT_HOME/bin/emctl stop agent

[oracle@gc ~]$ /u02/app/oracle/product/weblogic/agent11g/bin/emctl stop agent
Oracle Enterprise Manager 11g Release 1 Grid Control 11.1.0.1.0 
Copyright (c) 1996, 2010 Oracle Corporation.  All rights reserved.
Stopping agent ... stopped.
[oracle@gc ~]$

Stop the repository database

[oracle@gc ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Tue May 11 11:41:21 2010

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@gc ~]$ 

Stop the Listener

[oracle@gc ~]$ lsnrctl stop

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 11-MAY-2010 11:42:03

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=gc)(PORT=1521)))
The command completed successfully
[oracle@gc ~]$

That is it. Oracle Enterprise Manager 11g Grid Control and all associated services are now shutdown.

Starting Oracle Enterprise Manager 11g Grid Control

Start the Listener

[oracle@gc ~]$ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 11-MAY-2010 12:58:01

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Starting /u02/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /u02/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /u02/app/oracle/diag/tnslsnr/gc/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=gc.localdomain)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=gc)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                11-MAY-2010 12:58:01
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u02/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /u02/app/oracle/diag/tnslsnr/gc/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=gc.localdomain)(PORT=1521)))
The listener supports no services
The command completed successfully
[oracle@gc ~]$ 

Start the repository database

[oracle@gc ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Tue May 11 12:58:49 2010

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 1272213504 bytes
Fixed Size                  1336260 bytes
Variable Size             805309500 bytes
Database Buffers          452984832 bytes
Redo Buffers               12582912 bytes
Database mounted.
Database opened.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@gc ~]$ 

Start the Oracle Management Service

From the OMS_HOME directory run the following to start the OMS and WebTier services

OMS_HOME/bin/emctl start oms

[oracle@gc ~]$ /u02/app/oracle/product/weblogic/oms11g/bin/emctl start oms
Oracle Enterprise Manager 11g Release 1 Grid Control  
Copyright (c) 1996, 2010 Oracle Corporation.  All rights reserved.
Starting WebTier...
WebTier Successfully Started
Starting Oracle Management Server...
Oracle Management Server Successfully Started
Oracle Management Server is Up
[oracle@gc ~]$ 

Start the Oracle Management Agent

From the AGENT_HOME directory run the following to start the Agent.

AGENT_HOME/bin/emctl start agent

[oracle@gc ~]$ /u02/app/oracle/product/weblogic/agent11g/bin/emctl start agent
Oracle Enterprise Manager 11g Release 1 Grid Control 11.1.0.1.0 
Copyright (c) 1996, 2010 Oracle Corporation.  All rights reserved.
Starting agent ........ started.
[oracle@gc ~]$

Enterprise Manager 11g Grid Control and all associated services and can be accessed at https://servername.domain:7799/em.

21 thoughts on “Starting and Stopping Oracle Enterprise Manager 11g Grid Control”

  1. Thanks Eric. Been digging through the docs and this is light years better. I’m comfortable with GC 10g, but still learning 11g. This helps a lot.

  2. Hi,
    I would prefer to stop/start the database (running in $ORACLE_HOME) in a script without interaction with:

    $ORACLE_HOME/bin/dbshut $ORACLE_HOME
    and
    $ORACLE_HOME/bin/dbstart $ORACLE_HOME

    which will also stop/start your listener!

    This makes the whole stop/start script easy as:

    oracle@myhost:~> cat stop_grid.sh

    $ORACLE_HOME/bin/dbshut $ORACLE_HOME
    $AGENT_HOME/bin/emctl stop agent
    $OMS_HOME/bin/emctl stop oms -all

    oracle@myhost:~> cat start_grid.sh

    $ORACLE_HOME/bin/dbstart $ORACLE_HOME
    $AGENT_HOME/bin/emctl start agent
    $OMS_HOME/bin/emctl start oms

    If you simply put this in oracle $HOME directory, it’s very easy to use.

  3. My server was cold booted yesterday, before I stopped the agent first, then oms, then database then listener.
    later when I tried to restart all process I found out that the emctl file under oms11g/bin was 0 bytes, but not under agent11g/bin, can I copy this file over the oms11g/bin, please I need help

  4. Hello Miguel,

    I would not recommend copying the emctl binary from the agent home to OMS home. The binaries may or may not be similar. If you have a backup of your OMS home I would suggest restoring the file from the backup. If you do not have a backup you could trying installing the OMS into another home or another machine and then copying that binary to your existing OMS Home.

  5. Hi Eric,

    Nice …. Concise steps………… Really helpful.
    Dont know why Oracle cant keep it simple.

    Keep up the good work.

    thanks,
    Vijay

  6. Thanks for your detailed post. I had a lot off issues in getting to make a EM11gR1 work, but after a few days (may be there was a server restart), the OMS is not starting up. when I give emctl oms start, OMS is not starting up and giving a error.

    logfile:
    /u01/app/oracle/gc_inst/user_projects/domains/GCDomain/servers/EMGC_OMS1/logs/EMGC_OMS1.out

    OMS version 11.1.0.1.0 is not compatible with repository version 10.2.0.4.0 Repository needs to be upgraded.

    but my DB is 11.1.0.1.0 and its patched with bug fix 9066130. My WLS 10.3.2 is also patched with WDJ7.

    Pls advise. thx.

  7. Really excellent post.Concise and point to point. Much better than Oracle documentation.

    Thanks for sharing.

    Regards
    Amit

Leave a Reply

Your email address will not be published. Required fields are marked *