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

本站中文解释

Oracle视图DBA_HIST_WAITSTAT存储由AWR所记录的等待事件状态历史信息,其中包括等待事件的总数及按用户分组的等待事件状态历史的详细信息,一般用于查询数据库等待发生问题时的历史信息。

使用此视图需要满足如下条件:

1. SWITCHSTAT监控必须打开,可以使用如下语句查看监控是否打开:
SELECT CLIENT_NAME, SWITCH_TIME, STATUS FROM V$ACTIVE_SESSION_HISTORY WHERE EVENT LIKE ‘%switch%’;

2. 等待事件必须已经被监控,可以使用如下语句查看监控到的等待事件:
SELECT * FROM V$WAITSTAT;

使用此视图可以查询某一特定时间段内的等待事件状态信息,可以指定多种排序方式,例如:

SELECT *
FROM DBA_HIST_WAITSTAT
WHERE SNAP_ID BETWEEN &snap_id_start AND &snap_id_end
ORDER BY SNAP_ID;

官方英文解释

DBA_HIST_WAITSTAT displays historical block contention statistics. This view contains snapshots of V$WAITSTAT.

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

CLASS

VARCHAR2(18)

NOT NULL

Class of the block

WAIT_COUNT

NUMBER

Number of waits by the OPERATION for this CLASS of block

TIME

NUMBER

Sum of all wait times for all the waits by the OPERATION for this CLASS of block

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$WAITSTAT”


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