V$METRIC - Real-Time Database Performance Metrics & Throughput
V$METRIC
Section titled “V$METRIC”Overview
Section titled “Overview”V$METRIC holds the most recent computed metric values for each metric in Oracle’s metric collection framework, covering the last completed 60-second (long duration) and 15-second (short duration) measurement intervals. DBAs use this view for lightweight real-time monitoring of key performance indicators — DB time per second, I/O throughput, redo generation rate, and user transactions per second — without the overhead of querying AWR or parsing raw cumulative statistics. The values are pre-computed rates, making them immediately actionable.
View Type: Dynamic Performance View Available Since: Oracle 10g R1 Required Privileges: SELECT on V_$METRIC or SELECT_CATALOG_ROLE or SELECT ANY DICTIONARY
Key Columns
Section titled “Key Columns”| Column | Datatype | Description |
|---|---|---|
| BEGIN_TIME | DATE | Start timestamp of the measurement interval |
| END_TIME | DATE | End timestamp of the measurement interval |
| INTSIZE_CSEC | NUMBER | Interval size in centiseconds (6000 = 60 seconds, 1500 = 15 seconds) |
| GROUP_ID | NUMBER | Metric group identifier (2 = System Metrics Long, 3 = System Metrics Short) |
| METRIC_ID | NUMBER | Unique numeric identifier for the metric |
| METRIC_NAME | VARCHAR2(64) | Human-readable name of the metric |
| VALUE | NUMBER | Computed metric value for the interval |
| METRIC_UNIT | VARCHAR2(64) | Unit of measure (e.g., “per second”, “percent”, “microseconds”) |
| CON_ID | NUMBER | Container ID (12c+); 0 = CDB-wide or non-CDB |
Essential Queries
Section titled “Essential Queries”Basic Usage
Section titled “Basic Usage”List all current metrics with their values and units, sorted by metric name:
SELECT group_id, metric_id, metric_name, ROUND(value, 4) AS value, metric_unit, begin_time, end_timeFROM v$metricORDER BY metric_name;Key System Metrics — Current DB Time and CPU Rate
Section titled “Key System Metrics — Current DB Time and CPU Rate”Retrieve the most critical performance indicators in a single query. These five metrics give an immediate pulse of database workload:
SELECT metric_name, ROUND(value, 4) AS value, metric_unit, begin_time, end_time, ROUND(intsize_csec / 100, 0) AS interval_secondsFROM v$metricWHERE group_id = 2 -- System Metrics Long Duration (60-second intervals) AND metric_name IN ( 'DB Time Per Sec', 'DB CPU Time Per Sec', 'User Transaction Per Sec', 'User Calls Per Sec', 'SQL Service Response Time' )ORDER BY metric_name;Monitoring Query — I/O Throughput and Redo Rate
Section titled “Monitoring Query — I/O Throughput and Redo Rate”Monitor storage and redo subsystem performance in real time. Spikes in physical I/O or redo generation often precede space or performance incidents:
SELECT metric_name, ROUND(value, 2) AS value, metric_unit, begin_time, end_timeFROM v$metricWHERE group_id = 2 AND metric_name IN ( 'Physical Reads Per Sec', 'Physical Writes Per Sec', 'Physical Read Bytes Per Sec', 'Physical Write Bytes Per Sec', 'Redo Generated Per Sec', 'Redo Generated Per Transaction', 'Logons Per Sec', 'Open Cursors Per Sec' )ORDER BY metric_name;Combined with Other Views — Metric History from AWR
Section titled “Combined with Other Views — Metric History from AWR”Join V$METRIC with DBA_HIST_SYSMETRIC_SUMMARY to compare the current interval against the historical average and flag anomalies. Requires the Diagnostics Pack license:
SELECT m.metric_name, ROUND(m.value, 2) AS current_value, m.metric_unit, ROUND(h.average, 2) AS hist_avg, ROUND(h.maxval, 2) AS hist_max, ROUND( (m.value - h.average) / NULLIF(h.average, 0) * 100, 1 ) AS pct_above_avgFROM v$metric m JOIN ( SELECT metric_name, AVG(average) AS average, MAX(maxval) AS maxval FROM dba_hist_sysmetric_summary WHERE begin_time >= SYSDATE - 7 -- last 7 days GROUP BY metric_name ) h ON h.metric_name = m.metric_nameWHERE m.group_id = 2ORDER BY ABS(m.value - h.average) / NULLIF(h.average, 0) DESC NULLS LASTFETCH FIRST 20 ROWS ONLY;Advanced Analysis — Short vs. Long Duration Comparison
Section titled “Advanced Analysis — Short vs. Long Duration Comparison”Compare the 15-second (short) and 60-second (long) metric intervals to detect transient spikes that the longer window smooths out. A large difference indicates a recent burst of activity:
SELECT long_m.metric_name, ROUND(long_m.value, 4) AS long_60s_value, ROUND(short_m.value, 4) AS short_15s_value, long_m.metric_unit, CASE WHEN long_m.value = 0 THEN NULL ELSE ROUND((short_m.value - long_m.value) / long_m.value * 100, 1) END AS pct_diffFROM v$metric long_m JOIN v$metric short_m ON short_m.metric_name = long_m.metric_name AND short_m.group_id = 3 -- Short Duration (15s)WHERE long_m.group_id = 2 -- Long Duration (60s) AND long_m.metric_name IN ( 'DB Time Per Sec', 'DB CPU Time Per Sec', 'Physical Reads Per Sec', 'Physical Writes Per Sec', 'Redo Generated Per Sec', 'User Transaction Per Sec', 'SQL Service Response Time', 'Network Bytes Per Sec' )ORDER BY ABS( COALESCE((short_m.value - long_m.value) / NULLIF(long_m.value, 0), 0) ) DESC;Network Throughput and Session Metrics
Section titled “Network Throughput and Session Metrics”SELECT metric_name, ROUND(value, 2) AS value, metric_unit, begin_timeFROM v$metricWHERE group_id = 2 AND metric_name IN ( 'Network Bytes Per Sec', 'Network Receives Per Sec', 'Network Sends Per Sec', 'Current OS Load', 'CPU Usage Per Sec', 'CPU Usage Per Transaction', 'Active Sessions', 'Active Parallel Sessions', 'Background CPU Time Per Sec' )ORDER BY metric_name;Common Use Cases
Section titled “Common Use Cases”- Real-time DB time monitoring —
DB Time Per Secabove 1.0 means Oracle is consuming more than one CPU-equivalent of work per second; aboveNUM_CPUSindicates saturation. - Transaction throughput baseline —
User Transaction Per SecandUser Calls Per Secestablish the application’s steady-state load; sudden drops signal connection or application problems. - SQL service response time alerting —
SQL Service Response Time(microseconds) is the end-user-visible latency metric; trending upward without a load increase indicates degradation. - Redo generation spikes — Sudden increases in
Redo Generated Per Seccan indicate bulk DML, uncommitted large transactions, or log archiving bottlenecks. - I/O throughput capacity planning — Track
Physical Read Bytes Per SecandPhysical Write Bytes Per Secagainst storage subsystem limits to predict when additional storage bandwidth will be needed. - OEM-independent dashboards — Feed
V$METRICinto custom monitoring scripts or third-party tools (Grafana, Nagios) when OEM is not available.
Metric Groups Reference
Section titled “Metric Groups Reference”| GROUP_ID | Name | Interval |
|---|---|---|
| 2 | System Metrics Long Duration | 60 seconds |
| 3 | System Metrics Short Duration | 15 seconds |
| 6 | Event Metrics | 60 seconds |
| 7 | Event Class Metrics | 60 seconds |
| 9 | Service Metrics | 60 seconds |
Related Views
Section titled “Related Views”- V$METRICNAME — Lookup table mapping METRIC_ID and GROUP_ID to METRIC_NAME and METRIC_UNIT; useful for translating numeric IDs.
- V$METRIC_HISTORY — Recent history of metric values (approximately the last hour) kept in the SGA; use when AWR is unavailable.
- V$SYS_TIME_MODEL — Cumulative time model statistics;
DB Time Per SecinV$METRICis derived from the delta ofV$SYS_TIME_MODELDB time. - V$SYSMETRIC_HISTORY — System metric history kept in memory; equivalent to
V$METRIC_HISTORYbut specifically for system-level metrics. - V$OSSTAT — OS-level CPU and memory statistics; compare
CPU Usage Per SecinV$METRICagainst OS BUSY_TIME for full-stack analysis.
Version Notes
Section titled “Version Notes”- Oracle 10g R1:
V$METRICintroduced as part of the Metrics framework supporting the Database Control performance pages. - Oracle 10g R2: Additional I/O metrics added (bytes per second variants); metric groups 6 and 7 (wait event and event class metrics) added.
- Oracle 11g:
SQL Service Response Timeand network metrics added;V$METRIC_HISTORYretention extended. - Oracle 12c R1:
CON_IDcolumn added; metrics collected per-PDB whenENABLE_PER_PDB_METRICSis set.V$CON_SYSMETRICprovides PDB-level equivalents. - Oracle 19c: No structural changes; metric collection is a core background activity unaffected by patch level.
- Oracle 21c / 23ai: Additional metrics related to Automatic Indexing activity and In-Memory advisor available in the metric framework.