You are on page 1of 22

1 Copyright 2013, Oracle and/or its affiliates. All rights reserved.

Insert Information Protection Policy Classification from Slide 12

Database Metrics in
Enterprise Manager 12c

Section 1

What are metrics?

Why do we collect metrics?

How are metrics collected?

when are metrics collected?

Demo: How to set Database Metrics

What are metrics?


Metrics are just sets of data which are collected for each target type in Enterprise
Manager 12c. For the database target type, lots of different metrics can be collected.
The full list is given in Oracle Database Plug-in Metric Reference Manual. But
examples of the kind of thing that can be collected are things like: Database status metrics
Database performance Metrics
Database security related metrics
Database storage related metrics
Database incident metrics etc.
Database configuration metrics

Why do we collect metrics?

Historical Purposes

Alerting Purposes

Why do we collect metrics?

Historical Purposes

Alerting Purposes

How are metrics collected?


The agent is responsible for collecting the metric data. The agent has different
methods to collect the data. For example:

Perl scripts which run OS Commands


Perl scripts which run SQL commands
SQL fetchlets

The agent connects to the database and runs sql from the scripts or metadata
xml files which are defined in the database plugin directory.
<install home of agent>/plugins/oracle.sysman.db.agent.plugin_12.1.0.X.0

The agent connects using the monitoring credentials which were supplied at
the time that the database was discovered/added in Cloud Control. By default
the monitor username is dbsnmp.

When are metrics collected?


A default set of agent/host metrics are collected as soon as the agent has been
deployed

A default set of database/listener/ASM metrics are collected as soon as the database


has been added

The metrics which are currently being collected can be seen from the metric and
collection settings (from the target home page)

Running the command emctl status agent scheduler on the agent machine shows all
the metric collection sets which are scheduled.

Demo Setting Database Metrics

Summary
Set Database metrics from :Database Home Page/Oracle database drop down menu/monitoring/metric and collection settings
Click on "all metrics" and expand all
Set Listener metrics from:Listener Home Page/Listener drop down menu/monitoring/metric and collection settings
Click on all metrics and expand all
From here you can:Change the metric thresholds

Enable/Disable metrics

Change the collection frequency

Section 2

Where will the database metric alerts be shown?

How else can we be notified about alerts (eg. different notification methods)?

Setting the same metric thresholds on multiple database targets

How to determine exact sql used to collect the metric data?

Demo: Where are the Database Metric alerts


shown?

Summary
Where will the Database Metric alerts be shown?
Critical and Fatal alerts are shown in "incidents and problems" on database home page

Warnings do not show on database home page by default

Can get warnings from incident manager (events without incidents)

Database home page, and incident manager are controlled by incident rules

Warning alerts can be cleared from incident manager by the default incident rule

Check for active alerts in "all metrics" (will show all active alerts even if they are old)

To prevent alerts expiring create a new incident rule (can create a copy of the oracle default
rule and edit it). Disable the default rule.

How else can EM notify about alerts?


Email Notification

SNMP Trap Notification

OS Command Notification

PL/SQL Notification

If intending to use any of the above methods, a Notification Method must first be created
from:Setup/Notifications/Notification Methods
In addition:The default incident rule must be subscribed to.
or

A new custom incident rule created.

Setting the same metric thresholds on multiple


database targets
Settings can be saved as a template and applied to other multiple databases. This is
known as monitoring templates.

Applying a monitoring template is a one-off operation in the sense that after the
monitoring template is applied, it does not stay in sync with the monitoring template It
just copies the metric collection settings of one database to another (or multiple)
database/(s).

Database Administration groups can be used so that monitoring templates can be


kept in sync with database targets

Demo - How to find out the exact SQL that is


used to collect the metric data?

What is the exact SQL used to collect the metric


data?

View the metric/script definitions in:-

<install home of agent>/plugins/oracle.sysman.db.agent.plugin_12.1.0.x.0/metadata


<install home of agent>/plugins/oracle.sysman.db.agent.plugin_12.1.0.x.0/scripts
For example:/u01/12103agent/plugins/oracle.sysman.db.agent.plugin_12.1.0.5.0/metadata/database.xmlp
Or Easier Alternative:

View the Metrics Browser (5th column)

Metric browser/Database Instance:<target name>/<metric name>/metric definition

Section 3

Agent evaluated V Server Generated metrics

About Server Generated Alerts

Demo of a server generated alert

Demo of an agent evaluated alert

Agent Evaluated V Server Generated Metrics


There are two types of database metrics :Metrics which are evaluated by the agent

Metrics which are evaluated/generated by the database itself (server generated alerts)
which the agent subscribes to.

The agent may also collect similar data (to the server generated alerts) in order to save
for historical purposes but this is not used for alerting purposes.

Note:
There is an Enhancement Request (bug:17572849) to remove the usage of server
generated alerts for Enterprise Manager Metrics.

About Server Generated Alerts


Evaluated by the Database itself

Agent subscribes to the Database SYS.ALERT_QUE

For an alert to be shown in EM, it must be generated in dba_outstanding_alerts

List of server generated alerts are given in Note:564260.1 "Supported RDBMS Metric on
Oracle Database 10.2 "

See Note:266970.1 "Understanding Oracle 10G - Server Generated Alerts"

Can be identified by the pushDescriptor in the metric definition:

<pushDescriptor><PD receiveletId="AQMetricsDB"/><prop name="QueueName" scope="GLOBAL"


optional="false" content="ALERT_QUE"/>

Can be tested using Note: 1541511.1 How to Test Whether the "Tablespace Space
Used (%)" Metric Alert is Working as Expected for a Database Instance or Cluster
Database Instance in Enterprise Manager 12c?

Agent Evaluated Metrics


Evaluated by the agent (by running sql script, sql fetchlet, OS script etc)

Test using Note:1600486.1 How to Check that Agent Evaluated Enterprise Manager Metric
Alerts are working as Expected in Enterprise Manager 12c Cloud Control

Can be manually forced to run at will by using:-

emctl control agent runCollection <target_name>:<target type> <metric collection name>


emctl control agent runCollection orcl:oracle_database Response
Can find the metric collection names from:-

emctl status agent scheduler

You might also like