Oracle 视图 DBA_HIST_SYSMETRIC_HISTORY 官方解释,作用,如何使用详细说明

本站中文解释

Oracle 视图 DBA_HIST_SYSMETRIC_HISTORY 是诊断性指标历史表。它用于跟踪近期系统指标活动,可以发现数据库中发生的问题,并进行诊断和优化。该视图可以帮助用户确定当前或过去某个时间点的操作状态,识别系统历史指标是否和它们应该处于的正常性状态相匹配。

使用 DBA_HIST_SYSMETRIC_HISTORY 视图可以查看特定系统指标的历史波动趋势,比如 CPU 负载,缓存命中率等。它还可以帮助检测出数据库的行为异常,以及帮助识别数据库性能瓶颈。另外,它还可以用来帮助监测系统运行趋势,诊断性能问题并提出优化建议。

使用此视图可以通过以下方式来获取诊断性指标的历史记录:

— 查看指定 MEATRIC 指标的最近 24 小时内的数据
SELECT timestamp, value
FROM dba_hist_sysmetric_history
WHERE metric_name = ‘CPU Usage Per Sec’
AND interval_length_minutes = 5
AND timestamp > SYSTIMESTAMP – INTERVAL ‘1’ DAY;

— 查看某段时间内指定 MEATRIC 指标的波动趋势
SELECT timestamp, value
FROM dba_hist_sysmetric_history
WHERE metric_name = ‘CPU Usage Per Sec’
AND interval_length_minutes = 5
AND timestamp > ‘2019-02-01’
AND timestamp

官方英文解释

DBA_HIST_SYSMETRIC_HISTORY externalizes all available history of the system metric values for the entire set of data kept in the database.

This view contains snapshots of V$SYSMETRIC_HISTORY.

Column Datatype NULL Description

SNAP_ID

NUMBER

NOT NULL

Unique snapshot ID

DBID

NUMBER

NOT NULL

Database ID for the snapshot

INSTANCE_NUMBER

NUMBER

NOT NULL

Instance number for the snapshot

BEGIN_TIME

DATE

NOT NULL

Begin time of the interval

END_TIME

DATE

NOT NULL

End time of the interval

INTSIZE

NUMBER

NOT NULL

Interval size (in hundredths of a second)

GROUP_ID

NUMBER

NOT NULL

Group ID

METRIC_ID

NUMBER

NOT NULL

Metric ID

METRIC_NAME

VARCHAR2(64)

NOT NULL

Metric name

VALUE

NUMBER

NOT NULL

Metric Value

METRIC_UNIT

VARCHAR2(64)

NOT NULL

Unit of measurement

CON_DBID

NUMBER

The database ID of the PDB for the sampled session

CON_ID

NUMBER

The ID of the container that CON_DBID identifies. Possible values include:

  • 0: This value is used for rows containing data that pertain to the entire CDB. This value is also used for rows in non-CDBs.

  • 1: This value is used for rows containing data that pertain to only the root

  • n: Where n is the applicable container ID for the rows containing data

See Also:

  • “V$SYSMETRIC_HISTORY”

  • “DBA_HIST_CON_SYSMETRIC_HIST”

  • “V$CON_SYSMETRIC_HISTORY”


数据运维技术 » Oracle 视图 DBA_HIST_SYSMETRIC_HISTORY 官方解释,作用,如何使用详细说明