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

本站中文解释

Oracle视图DBA_HIST_ASH_SNAPSHOT存储数据库应用程序自任务跟踪使用的信息,可以帮助DBA以窗口方式查看系统上活动的会话以及其执行的任务的性能。这个视图内的数据基于任务跟踪(AWR)报告的任务快照采样器数据收集的,可以帮助识别会话中正在执行的任务,滚动及重复任务。

使用时,首先要执行oracle脚本dbms_scheduler.create_snapshot来创建任务跟踪快照,采样时间可以根据实际情况进行调整,但不能小于15秒以下,然后查看DBA_HIST_ASH_SNAPSHOT 视图中的数据,根据任务的SQL_ID字段把任务的SQL文件和相关执行结果查询出来,根据这些信息就可以进行性能分析并得出解决方案了。

官方英文解释

DBA_HIST_ASH_SNAPSHOT provides the list of snapshots that contains Active Session History (ASH) data.

This view differs from DBA_HIST_SNAPSHOT in that it provides snapshots which had errors flushing some Automatic Workload Repository (AWR) tables, but for which ASH data may be successfully flushed (DBA_HIST_SNAPSHOT filters out snapshots which had errors flushing AWR tables).

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

STARTUP_TIME

TIMESTAMP(3)

NOT NULL

Startup time of the instance

BEGIN_INTERVAL_TIME

TIMESTAMP(3)

NOT NULL

Time at the beginning of the snapshot interval

END_INTERVAL_TIME

TIMESTAMP(3)

NOT NULL

Time at the end of the snapshot interval; the actual time the snapshot was taken

FLUSH_ELAPSED

INTERVAL DAY(5) TO SECOND(1)

Amount of time to perform the snapshot

SNAP_LEVEL

NUMBER

Snapshot level

STATUS

NUMBER

Indicates if the snapshot was successfully flushed without any errors. Possible values:

  • 0 – No errors

  • 1 – Errors on some AWR tables

ERROR_COUNT

NUMBER

Number of errors occurring in the tables for the particular snapshot

BL_MOVED

NUMBER

Reserved for internal use

SNAP_FLAG

NUMBER

Condition under which the snapshot was inserted. Possible values are:

  • 1 – Manual snapshot created using a PL/SQL package

  • 2 – Imported snapshot

  • 4 – Snapshot taken while Diagnostic Pack or Tuning Pack was not enabled

SNAP_TIMEZONE

INTERVAL DAY(0) TO SECOND(0)

Snapshot time zone expressed as offset from UTC (Coordinated Universal Time) time zone

CON_ID

NUMBER

The ID of the container to which the data pertains. 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:

“DBA_HIST_SNAPSHOT”


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