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

本站中文解释

Oracle视图DBA_HIST_EVENT_HISTOGRAM用于查询V$ACTIVE_SESSION_HISTORY视图中每个会话在每个事件之间经历的每个时间间隔段的数量。它提供了大量关于运行会话花在特定活动上的时间数据,用于确定数据库中经常性慢查询等性能问题的时间和异常的可能性。

要使用DBA_HIST_EVENT_HISTOGRAM视图,必须首先启动数据库的统计信息收集器,如果没有,可能无法查看DBA_HIST_EVENT_HISTOGRAM视图的任何内容。首先运行以下查询,以确定回收统计信息的间隔和阈值设置:

SQL> SELECT snap_interval,
snap_level
FROM dba_hist_baseline
WHERE baseline_name = ‘DEFAULT_BASELINE’;

若参数snap_interval为0,表示统计信息收集未启动。可以使用如下命令启动统计信息收集器:

SQL > EXEC DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS(’60’,’FORALL’,’DAILY’,’60’,’TYPICAL’,’DEFAULT_BASELINE’);

现在, 您可以使用DBA_HIST_EVENT_HISTOGRAM视图来查看系统活动事件的历史数据:

SQL>
SELECT *
FROM dba_hist_event_histogram
WHERE …
ORDER BY …;

官方英文解释

DBA_HIST_EVENT_HISTOGRAM displays event histogram historical statistics information.

This view contains snapshots of V$EVENT_HISTOGRAM.

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

EVENT_ID

NUMBER

NOT NULL

Identifier of the wait event

EVENT_NAME

VARCHAR2(64)

NOT NULL

Name of the wait event

WAIT_CLASS_ID

NUMBER

Identifier of the class of the wait event

WAIT_CLASS

VARCHAR2(64)

Name of the class of the wait event

WAIT_TIME_MILLI

NUMBER

NOT NULL

Wait time (in milliseconds)

WAIT_COUNT

NUMBER

Wait count

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:

“= 222 ms.”>V$EVENT_HISTOGRAM”


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