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

本站中文解释

视图

Oracle视图DBA_HIST_SQL_SUMMARY提供以SQL语句为中心的查询信息,用于查询以前执行的查询,主要用于诊断语句。 该视图包含了以下列:

•SQL_ID: 标识一个SQL语句的ID
•EXECUTIONS_DELTA:最近两次收集时SQL语句的执行次数之差
•ELAPSED_TIME_DELTA:最近两次收集时SQL语句的总消耗时间之差
•CPU_TIME_DELTA:最近两次收集时SQL语句的CPU消耗时间之差
•IOWAIT_DELTA:最近两次收集时SQL语句的I/O等待时间之差
•GETS_SUM:一段时间内SQl语句的行读取次数之和
•READ_TIME_SUM:一段时间内SQL语句的行读取消耗时间之和

使用方法:

要使用DBA_HIST_SQL_SUMMARY视图,可以使用以下查询将SQL_ID跟总消耗时间之差join起来:
SELECT SQL_ID,ELAPSED_TIME_DELTA
FROM DBA_HIST_SQL_SUMMARY;

要查看一段时间内SQL语句的行读取次数之和,可以使用以下查询:
SELECT SQL_ID, GETS_SUM
FROM DBA_HIST_SQL_SUMMARY
WHERE SNAP_ID>=
AND SNAP_ID;

官方英文解释

DBA_HIST_SQL_SUMMARY displays historical SQL summary information.

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

TOTAL_SQL

NUMBER

NOT NULL

Total number of SQLs

TOTAL_SQL_MEM

NUMBER

NOT NULL

Total sharable memory in bytes for SQLs

SINGLE_USE_SQL

NUMBER

NOT NULL

Total number of single execution SQLs

SINGLE_USE_SQL_MEM

NUMBER

NOT NULL

Total sharable memory in bytes for single execution SQLs

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


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