Showing posts with label Metrics and Alerts. Show all posts
Showing posts with label Metrics and Alerts. Show all posts

Friday, December 6, 2013

Statistic Histograms

Limitation of Oracle Metrics and Statistic Histograms
Although the metrics can give you an idea of the trend for particular statistics, they do not tell you if a particular bottleneck is affecting the whole system or if it is just localized. As an example, you can observe a high metric rate but this sudden increase could be localized to only one or two sessions in your system. In this case, it might not be worth investigating the issue. However, if the sudden increase is generalized to the whole system, you need to investigate further. This information is available via histogram performance views.

As shown in the diagram, you observe a sudden increase in your I/O rate. You can correlate this information to the corresponding I/O histogram found in V$FILE_HISTOGRAM. This view displays a histogram of all single block reads on a per-file basis. The histogram has buckets of time intervals, measured in milliseconds, from 1 ms up to 222 ms (69.9 minutes). The value in each bucket is the number of times the system waited for that amount of time. For example, you can see from the slide that the system waited 5,500 times for more than 32 ms and less than 64 ms to read blocks from disks. This is certainly a cause of concern for your system if the access times are normally less than 10 ms, and you should investigate this further. Had you seen large numbers in shorter wait time periods, you would not have worried much.

The metrics are able to alert you to a potential problem. By drilling down using histograms, you can clearly determine whether there really is a problem.



Histogram Views
V$EVENT_HISTOGRAM displays a histogram of the number of waits on an event basis.
V$FILE_HISTOGRAM displays a histogram of all single block reads on a per file basis.
V$TEMP_HISTOGRAM displays a histogram of all single block reads on a per temp-file basis.

The histogram has buckets of time intervals from < 1 ms, < 2 ms, < 4 ms, < 8 ms, ... < 2^21 ms, < 2^22 ms, >= 2^22 ms.
You can also visualize the histogram statistics from Enterprise Manager. From the Performance page, click one of the legend area items for the Active Sessions graph such as User I/O to drill down to the Active Sessions Waiting: User I/O page. Again, click the wait event name to the right of Active Sessions graph to reach the corresponding “Histogram for Wait Event” page. The “Histogram for Wait Event: db file sequential read” graph is shown in the slide.
Note: The histogram will not be filled unless the TIMED_STATISTICS initialization parameter is set to TRUE, which is the default value. TIMED_STATISTICS is set automatically when the STATISTICS_LEVEL parameter is set to TYPICAL or ALL.

Metrics, Alerts, and Baselines

A metric is a timed rate of change in a cumulative statistic. For example, physical reads per second. 


Threshold values can be set for various metrics, and when the value of the metric crosses the threshold value, an alert is generated.

Monitoring for performance requires certain information that goes beyond statistics. To determine whether a particular statistic is important, you need to know how much it has changed over a certain period of time. 

To be proactive, you need to be notified when certain conditions exist, for example when system response time approaches the agreed maximum. To diagnose performance issues, you need to know what has changed. Metrics, alerts, and baselines provide this information.

A metric is a timed rate of change in a cumulative statistic. For example, physical reads per second.

A metric is another type of statistic collected by Oracle Database. A metric is defined as the rate of change in some cumulative statistic. That rate can be measured against a variety of units, including time, transactions, or database calls. For example, the number database calls per second is a metric. Metric values are exposed in some V$ views, where the values are the average over a fairly small time interval, typically 60 seconds. A history of recent metric values is available through V$ views, and some data is also persisted by AWR snapshots.

Threshold values can be set for various metrics, and when the value of the metric crosses the threshold value, an alert is generated.


A baseline comprises stored sets of metrics and statistics. A single set is called a snapshot. A baseline is made up of two or more snapshots. 

Usually a baseline is captured during a period of normal or acceptable operation, but it can capture any period of interest. When performance is not as expected, another set of metrics can be captured and compared with the baseline. This method allows the data to clearly point to the performance issues.


The Oracle database server collects base statistics during normal operations. Base statistics are simple counts. For example, counting the number of physical reads in the system since startup is a base statistic.

Metrics are secondary statistics derived from base statistics. Most metrics track the rates of change of activities in the Oracle server. For example, the average physical reads in the system in the last 60 minutes is a metric. Metrics are used by internal components (clients) for system health monitoring, problem detection, and self-tuning. The Manageability Monitor process (MMON) periodically updates metric data from the corresponding base statistics.

Oracle Database 11g supports metrics for system, sessions, files, and wait event statistics. Each metric is uniquely identified by a metric number and is associated with a metric name.


Benefits of Metrics

  • The main benefit of keeping metrics is that when a component needs to compute the rate of change of some activity, the data is readily available.
  • In earlier releases, you had to capture statistics before and after running a workload to compute the changed rate for a particular base statistic. With metrics, all you need to do is run your workload and select the corresponding metrics.
  • Metrics provide the performance information required for the Automatic Memory Management and Automatic Database Diagnostic Monitor.