13 Oracle Enterprise Manager Management Agent

This chapter introduces Oracle Enterprise Manager Management Agent, and provides configuration information.

The following topics are included:

13.1 Overview

Oracle Management Agent runs jobs and events sent by Oracle Enterprise Manager and can start and shut down a database. It can function regardless of the status of the network connection, and it can run even if the database is down. It enables the database administrator to monitor and control a database from a central location on the network.

Oracle Management Agent is controlled using a command in the z/OS UNIX System Services shell environment. Currently, it is the only component of Oracle Enterprise Manager that is implemented for Oracle Database for z/OS. For more information about Oracle Management Agent, refer to the Oracle Enterprise Manager documentation set.

13.2 Configuring Oracle Management Agent

Oracle Management Agent is installed with Oracle Database for z/OS. Oracle Universal Installer also configures most of the required parameters.

For Oracle Management Agent to work correctly on z/OS, the following changes must be made to the system:

  • Oracle Management Agent is a multi-threaded application which starts and stops numerous threads during its operation. The BPX parameter file must be altered and activated on your system, as follows:

    MAXTHREADS(20000)
    

    BPX parameters are set in the SYS1.PARMLIB(BPXxxx).

  • The nmo and nmp executable must have its extended attributes set as follows:

    extattr +p nmo
    extattr +p nmb
    

    This is because the executable uses the c function __passwd to verify a user and password before attempting to execute a command on behalf of a user (for example, database shutdown and startup).

  • The ownership of the em* executables in the ORACLE_HOME/bin directory must be set to that of the user who will run Oracle Management Agent.

To complete the configuration, the following three files need additional customization:

  • The emd.properties file in the sysman/config directory

    This file contains the global variables for Oracle Management Agent. For most installations, the following two parameters must be modified:

    • REPOSITORY_URL=http://host:port/em/upload/

      This is the location of Oracle Management Service where you want Oracle Management Agent to register.

    • EMD_URL=http://local_host:local_port/emd/main/

      This is the location and port where you want Oracle Management Agent to listen for communications from clients.

  • The targets.xml file in the sysman/emd directory

    This file contains the information about the local system and its database instances. It is in XML format and must be customized. Although Oracle Management Agent attempts to configure this file, z/OS differences may not permit it to do so.

    The following is a sample targets.xml file:

<?xml version="1.0" encoding="IBM-1047"?>
<Targets AGENT_SEED="agent_seed">
 <Target TYPE="oracle_emd" NAME="local_host:local_port" VERSION="1.0"
 <Target TYPE="host" NAME="local_host" VERSION="1.0"/>
 <Target TYPE="oracle_database" NAME="DB_sid" VERSION="1.0">
  <Property NAME="MachineName" VALUE="local_host"/>
  <Property NAME="Port" VALUE="DB_port"/>
  <Property NAME="SID" VALUE="DB_sid"/>
  <Property NAME="ConnectDescriptor" VALUE="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=local_host)(PORT=DB_port))(CONNECT_DATA=(SID=DB_sid)))"/>
  <Property NAME="OracleHome" VALUE="oracle_home"/>
  <Property NAME="UserName" VALUE="DBSNMP"/>
  <Property NAME="password" VALUE="password" ENCRYPTED="FALSE"/>
  <Property NAME="Role" VALUE="NORMAL"/>
 </Target>
</Targets>

Variables for the previous example are defined as follows:

Table 13-1 Variable Descriptions for Code Example

Variable Description

agent_seed

The value of this parameter should be the same as that of the agentSeed parameter in the emd.properties file

local_host

Local host name of z/OS

The value of the local_host parameter in the emd.properties file and targets.xml file must be the same.

local_port

Value of the local_port

oracle_database

Oracle instance on the local system or a remote system

DB_port

Port on which the instance is listening

DB_sid

External SID specified in the OSDI database service definition

oracle_home

Location of the Oracle database software

UserName

DBSNMP database user account

password

DBSNMP database user account password

Once Oracle Management Agent starts, it alters the targets.xml file to encrypt this password.


  • The /var/opt/oratab file

    This file should contain one line for every database instance being configured, as in the following example:

    instance_name:ORACLE_HOME:N
    

    In the previous example, instance_name is the name of the database instance, and ORACLE_HOME is the Oracle home where the Oracle database software is located.

13.3 Controlling Oracle Management Agent

You use the emctl command to control Oracle Management Agent. For a description of this and other Management Agent commands, refer to Oracle Enterprise Manager Advanced Configuration manual.

To issue this command, first log in to the z/OS UNIX System Services environment as the user who owns Oracle Management Agent code. This user also needs DBA privileges.

Set up environment variables in the ENV file located in the Oracle home directory.

To start Oracle Management Agent, use the following command:

$ emctl start agent

To query the status of agent, use the following command:

$ emctl status agent

To upload the information of Oracle Management Agent to the Management Service, use the following command:

$ emctl upload

The host information appears at the Management Service location. you must upload the information only if the status of the agent is not automatically updated.

To stop Oracle Management Agent, use the following command:

$ emctl stop agent

The log files and tracing information will be written to the ORACLE_HOME/sysman/log file.