Sei sulla pagina 1di 36

4

Metrics, Alerts, and Baselines

Copyright © 2006, Oracle. All rights reserved.


Objectives

After completing this lesson, you should be able to do


the following:
• View metrics by using the metrics history views
• Create metric thresholds
• View alerts
• Create metric baselines
• Enable adaptive thresholds

4-2 Copyright © 2006, Oracle. All rights reserved.


Metrics, Alerts, and Baselines

Metric: Rate of change in a cumulative statistic


Alert: Event generated when a monitored metric
crosses a threshold
Baseline: Data gathered from a “normal running
database” for performance comparison

4-3 Copyright © 2006, Oracle. All rights reserved.


Limitation of Base Statistics

2M

High rate
V$SYSSTAT
I/O
Physical reads 30 minutes

Time
2M
Low rate

30 minutes
I/O
Statistics just keep
growing.

Time

4-4 Copyright © 2006, Oracle. All rights reserved.


Typical Delta Tools

• Comparison of statistics at two points in time is


needed.
• The following tools produce deltas:
– Statspack
– AWR reports
– Customized scripts

4-5 Copyright © 2006, Oracle. All rights reserved.


Oracle Database 10g Solution: Metrics

V$SYSMETRIC V$FILEMETRIC
V$METRICNAME
V$SESSMETRIC V$EVENTMETRIC

V$SERVICEMETRIC V$WAITCLASSMETRIC

Client 1 Client 2 Client 3 Client 4

MMON Metric 1 Metric 2 Redo generation/Tx

Base statistic 1

Redo generation User commit User rollback

4-6 Copyright © 2006, Oracle. All rights reserved.


Benefits of Metrics

DBA

Query a metric.
Analyze differences.

Without metrics With metrics

4-7 Copyright © 2006, Oracle. All rights reserved.


Viewing Metric History Information
• In memory:
– V$SYSMETRIC_HISTORY
– V$FILEMETRIC_HISTORY
– V$WAITCLASSMETRIC_HISTORY
– V$SERVICEMETRIC_HISTORY
– V$SESSION_WAIT_HISTORY (last 10 events)
• On disk:
– DBA_HIST_SYSMETRIC_SUMMARY
– DBA_HIST_SYSMETRIC_HISTORY (alerts only)
– DBA_HIST_SESSMETRIC_HISTORY
– DBA_HIST_SYSTEM_EVENT (cumulative)
– DBA_HIST_FILEMETRIC_HISTORY (alerts only)
– DBA_HIST_FILESTATXS (cumulative)
– DBA_HIST_WAITCLASSMET_HISTORY (alert)

4-8 Copyright © 2006, Oracle. All rights reserved.


Viewing Detailed Information for a Metric

4-9 Copyright © 2006, Oracle. All rights reserved.


Statistic Histograms

High rate
V$SYSSTAT
I/O
Physical reads 30 minutes

Time Is it a
real problem?
5500

V$FILE_HISTOGRAM
Number
of
waits

Time
1 2 4 8 16 32 64 128 256 512 … 222 period

4-10 Copyright © 2006, Oracle. All rights reserved.


Histogram Views

• V$EVENT_HISTOGRAM: For each event such as “db


file sequential read”
• V$FILE_HISTOGRAM: For single block reads on a
per data file basis
• V$TEMP_HISTOGRAM: For single block reads on a
per temp-file basis

4-11 Copyright © 2006, Oracle. All rights reserved.


Server-Generated Alerts

Enterprise Manager

Server
alerts
Oracle queue.
instance
Metric exceeds
threshold.

AWR

4-12 Copyright © 2006, Oracle. All rights reserved.


Database Control Usage Model

Enable alerts by setting thresholds.

Set up notification rules (paging, e-mail).

Receive notification.

Review alert details and advice.

Correct the problem.

Verify that the problem is resolved.

4-13 Copyright © 2006, Oracle. All rights reserved.


Setting Thresholds

4-14 Copyright © 2006, Oracle. All rights reserved.


Creating and Testing an Alert

1. Specify a threshold.
2. Create a test case.
3. Check for an alert.
1
2

4-15 Copyright © 2006, Oracle. All rights reserved.


Metric and Alert Views

Recent metrics Metric history Server alerts

DBA_HIST_SYSMETRIC_HISTORY
...

DBA_OUTSTANDING_ALERTS
V$SYSMETRIC_HISTORY
DBA_ALERT_HISTORY
V$SYSMETRIC
DBA_THRESHOLDS
V$SERVICEMETRIC
V$ALERT_TYPES
V$METRICNAME
...
...

4-16 Copyright © 2006, Oracle. All rights reserved.


User-Defined SQL Metrics

4-17 Copyright © 2006, Oracle. All rights reserved.


Practice Overview:
Work with Metrics

This practice covers the following topics:


• View metrics using the metrics history views
• Create metric thresholds
• View alerts
• Clear alerts

4-18 Copyright © 2006, Oracle. All rights reserved.


Working with Metric Baselines

• Enable metric baselines.


• Create a metric baseline.
– Static baseline
– Moving window baseline
• View the baseline statistics.
• Set a threshold on a baseline.
– Fixed threshold (percent of maximum)
– Adaptive threshold

4-19 Copyright © 2006, Oracle. All rights reserved.


Enabling Metric Baselining

4-20 Copyright © 2006, Oracle. All rights reserved.


Creating Static Metric Baselines

4-21 Copyright © 2006, Oracle. All rights reserved.


Creating Static Metric Baselines

4-22 Copyright © 2006, Oracle. All rights reserved.


Time Grouping

Baseline period

Daily Weekly
Time
grouped

Hour Day All Day Weekdays All


of day and night hours of week and weekend days

8am 11am Mo Su Mo Su
7am 7pm 7am

7am 7pm 7am Mo Sa&Su

4-23 Copyright © 2006, Oracle. All rights reserved.


Time Grouping: Considerations

1 week ago Moving window size 7 days


Data 2 weeks ago
points Grouped by Day of week
Sufficiency level
Sufficient data? No

Mo Tu We Th Fr Sa Su

Data Moving window size 14 days


points Grouped by Day of week
Sufficient data? Yes

Mo Tu We Th Fr Sa Su
Moving window size 7 days
Data
Grouped by Weekdays
points and weekend
Sufficient data? Yes
Weekdays Weekend

4-24 Copyright © 2006, Oracle. All rights reserved.


Activating the Static
Metric Baseline

4-25 Copyright © 2006, Oracle. All rights reserved.


Activating the Moving Window
Metric Baseline

4-26 Copyright © 2006, Oracle. All rights reserved.


Visualizing Metric Baseline Statistics

4-27 Copyright © 2006, Oracle. All rights reserved.


Setting Adaptive Alert Thresholds

4-28 Copyright © 2006, Oracle. All rights reserved.


Setting Adaptive Alert Thresholds

4-29 Copyright © 2006, Oracle. All rights reserved.


Metric Baseline and Adaptive
Threshold: Considerations

• Baselining must be enabled using Enterprise


Manager.
• Only one moving window baseline can be defined.
• Multiple static baselines can be defined.
• Only one baseline can be active at a time.
• Adaptive thresholds require an active baseline.

4-30 Copyright © 2006, Oracle. All rights reserved.


Classification of Eligible Metrics
Performance Metrics
Database Time (centiseconds per second)
Response Time (per transaction)
System Response Time (centiseconds)

Workload Volume Metrics


Executes (per second)
Redo Generated (per second)
Network Bytes (per second)
Physical Writes (per second)
Physical Reads (per second)
Current Logons Count
User Calls (per second)
Number of Transactions (per second)

Workload Type Metrics


Database Block Changes (per transaction)
Enqueue Requests (per transaction)
Total Parses (per transaction)
Session Logical Reads (per transaction)

4-31 Copyright © 2006, Oracle. All rights reserved.


Metric Baseline: Normalized View

4-32 Copyright © 2006, Oracle. All rights reserved.


Configuring Normalization Metrics

4-33 Copyright © 2006, Oracle. All rights reserved.


Adaptive Thresholds and the All Metrics Page

4-34 Copyright © 2006, Oracle. All rights reserved.


Practice Overview:
Work with Baselines

This practice covers the following topics:


• Create a static metric baseline
• View the baseline data
• Enable adaptive thresholds
• View deviations from the baseline

4-35 Copyright © 2006, Oracle. All rights reserved.


Summary

In this lesson, you should have learned how to:


• View metrics by using the metrics history views
• Create metric thresholds
• View alerts
• Create metric baselines
• Enable adaptive thresholds

4-36 Copyright © 2006, Oracle. All rights reserved.

Potrebbero piacerti anche