Introducción
Grid Control se compone de una serie de servicios, cada uno de los cuales está instalado en su propio HOME y que pueden y deben ser manejados separadamente. El objetivo de este manual es presentar de manera concreta los comandos necesarios para levantar, detener y monitorear todos estos servicios. Las partes correspondientes a levantar y detener los servicios deben ejecutarse en el orden indicado.
Variables de ambiente
Es recomendable definir las siguientes variables de ambiente:
# Variables de ambiente para Grid Control
OMS_HOME=/opt/oracle/OracleHomes/oms10g
export OMS_HOME
AGENT_HOME=/opt/oracle/OracleHomes/agent10g
export AGENT_HOME
ORACLE_HOME=/opt/oracle/OracleHomes/db10g
export ORACLE_HOME
ORACLE_SID=emrep
export ORACLE_SID
PATH=$PATH:$OMS_HOME/bin:$AGENT_HOME/bin:$ORACLE_HOME/bin:$OMS_HOME/opmn/bin
export PATH
En este caso se asume que la instalación de Grid Control se hizo en el directorio /opt/oracle, en caso de encontrarse en una ubicación diferente, realizar los cambios necesarios en las variables de ambiente.
Levantar todos los servicios
1. Levantar el listener:
$ $ORACLE_HOME/bin/lsnrctl start
2. Levantar la base de datos:
$ $ORACLE_HOME/bin/sqlplus /nolog
SQL> connect SYS as SYSDBA
SQL> startup
SQL> quit
3. Levantar OMS (Oracle Management Service):
$ $OMS_HOME/bin/emctl start oms
4. Levantar todos los componentes de Application Server (web cache, http server):
$ $OMS_HOME/opmn/bin/opmnctl startall
5. Levantar el agente:
$ $AGENT_HOME/bin/emctl start agent
6. (Opcional) Levantar el Application Server Control Console:
$ $OMS_HOME/bin/emctl start iasconsole
Detener todos los servicios
1. Detener el OMS:
$ $OMS_HOME/bin/emctl stop oms
2. Detener, si está arriba, el Application Server Control Console:
$ $OMS_HOME/bin/emctl stop iasconsole
3. Detener todos los componentes del Application Server (http server, web cache, etc.):
$ $OMS_HOME/opmn/bin/opmnctl stopall
4. Detener el agente:
$ $AGENT_HOME/bin/emctl stop agent
5. Detener la base de datos
$ $ORACLE_HOME/bin/sqlplus /nolog
SQL> connect SYS as SYSDBA
SQL> shutdown
SQL> quit
6. Detener el listener:
$ $ORACLE_HOME/bin/lsnrctl stop
Monitorear los servicios
Agente:
$AGENT_HOME/bin/emctl status agent
OMS (Oracle Management Service):
$ $OMS_HOME/bin/emctl status oms
Componentes de Application Server:
$ $OMS_HOME/opmn/bin/opmnctl status
Detener OCSSD.BIN
El proceso $ORACLE_HOME/bin/ocssd.bin se levanta automáticamente como parte de la instalación de RDBMS incluida en Grid Control. Dicho proceso no requiere administración alguna, sin embargo, de ser necesario detenerlo (generalmente durante la aplicación de parches), el proceso correcto para hacerlo es (con el usuario root):
# /etc/init.d/init.cssd stop
$AGENT_HOME/sysman/emd/state
export AGENT_HOME=/opt/oracle/product/agent10g/
echo $AGENT_HOME
rm –Rf $AGENT_HOME/sysman/emd/upload/*.*
rm –Rf $AGENT_HOME/sysman/emd/state/*.*
$ ./emctl clearstate agent
$ ./emctl unsecure agent
$ ./emctl start agent
$ ./emctl upload agent
$ ./emctl secure agent
OTROS COMANDOS
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.
1
2
3
4
|
[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.
1
2
3
4
5
6
7
8
9
10
11
|
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.
1
2
3
4
5
6
7
|
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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
[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
1
2
3
4
5
6
7
8
9
|
[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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
[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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
[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
1
2
3
4
5
6
7
8
9
10
11
|
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.
1
2
3
4
5
6
7
|
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
~]$ |