---
title: "分析 ASH 报告 - OceanBase 数据库 V4.2.4 | OceanBase 文档中心"
description: 分析 ASH 报告 生成 ASH 报告后, 查看其内容以确定瞬时性能问题的可能原因。 ASH 报告内容 ASH 报告中通过 ASH Report 部分记录采样的起止时间、分析的起止时间、诊断的时间、样本的数量、事件的数量和平均活动会话数量这些信息，生成 Top Active Tenants、Top Node Load…
---
切换语言

- 中文站 - 简体中文
- International - English
- 日本站 - 日本語

文档反馈![](https://mdn.alipayobjects.com/huamei_22khvb/afts/img/A*P8CuR4UJ_FkAAAAAAAAAAAAADiGDAQ/original) OceanBase 数据库分布式版 - V 4.2.4

# 分析 ASH 报告

更新时间：2024-07-11 00:04:56

[编辑](https://github.com/oceanbase/oceanbase-doc/edit/V4.2.4/zh-CN/700.reference/1000.performance-tuning-guide/400.performance-diagnosis/500.ash-report-diagnosis/300.analyze-ash-report.md)  

生成 ASH 报告后, 查看其内容以确定瞬时性能问题的可能原因。

## ASH 报告内容

ASH 报告中通过 ASH Report 部分记录采样的起止时间、分析的起止时间、诊断的时间、样本的数量、事件的数量和平均活动会话数量这些信息，生成 Top Active Tenants、Top Node Load、Top Foreground DB Time、Top Execution Phase、Top Background DB Time、Top Sessions、Top groups、Top Latchs、Activity Over Time、Top SQL Statement Types、Top SQL with Top DB Time、Top SQL with Top Events、Top SQL with Top Operator、Top PL/SQL Procedures、Complete List of SQL Text 等 15 个模块的信息，从多个维度或组合（例如时间、会话、模块、操作或 SQL 语句）进行范围或目标的性能分析。

### ASH Report

这部分显示 ASH（Active Session History）报告中一些关于采样时间、分析时间和一般统计数据的信息。

- Cluster Name：集群的名称，表示数据库集群的名称。
 - Observer Version：OceanBase 数据库版本信息，包含版本号和详细的构建版本。
 - Operation System Info：操作系统信息，包括内核版本和架构。
 - User Input Begin Time：采样开始的时间，表示开始记录会话活动的时间点。
 - User Input End Time：采样结束的时间，表示停止记录会话活动的时间点。
 - Analysis Begin Time：分析开始的时间，表示对采样数据进行分析的起始时间点。
 - Analysis End Time：分析结束的时间，表示对采样数据进行分析的结束时间点。
 - Elapsed Time：所有采样时间的总秒数。
 - Num of Sample：采样的数量，表示记录到的会话活动次数。
 - Average Active Sessions：平均活跃会话数，表示在采样期间的平均活跃会话数量。

这些信息提供了关于 ASH 报告的统计数据，包括系统的版本、操作系统环境、信息采样时间段、分析时间段、采样数量、事件数量和平均活跃会话数。通过这些数据可以了解采样期间的活动情况、会话和事件的数量，以及系统的活跃程度。

```shell
ASH Report

           Cluster Name: test424
       Observer Version: OceanBase 4.2.4.0 (200000342024061210-c4c0c18741e45a1d40889b6147c3132574xxxxxx)
  Operation System Info: Linux(3.10.0-327.ali2019.alios7.x86_64)_x86_64
  User Input Begin Time: 2023-09-22 10:26:47
    User Input End Time: 2024-06-22 20:27:07
    Analysis Begin Time: 2024-06-13 18:24:34
      Analysis End Time: 2024-06-14 17:42:35
           Elapsed Time: 83880
          Num of Sample: 17386
Average Active Sessions: 0.21

```

### Top Active Tenants

这部分显示了最活跃的租户信息。

- Tenant ID：租户 ID，标识特定租户的信息。
 - Session Type：会话类型，可能值包括 BACKGROUND 和 FOREGROUND，分别表示后台进程和前台进程。
 - Total Count：总记录数，表示在 ASH 报告分析时间段内的总样本数。
 - Wait Event Count：等待事件数，表示会话在等待事件上的样本数。
 - On CPU Count：CPU 上的样本数，表示会话在 CPU 上执行的样本数。
 - Avg Active Sessions：平均活跃会话数，表示在采样期间该阶段平均同时有多少数据库会话处于活跃状态（不论是在 CPU 上还是在等待事件）。
 - % Activity：事件的活动百分比，表示给定租户在指定时间段内的活动（CPU + 等待）百分比。

这些信息提供了关于租户活动的细节，揭示了数据库性能的不同方面以及租户对资源的使用情况。

```shell
Top Active Tenants:
  - this section lists top active tenant information
  - Total Count: num of records during ash report analysis time period
  - Wait Event Count: num of records when session is on wait event
  - On CPU Count: num of records when session is on cpu
  - Avg Active Sessions: average active sessions during ash report analysis time period
  - % Activity: activity(cpu + wait) percentage for given tenant
+---------+------------+------------------+-----------------------+-------------------+--------------------+-----------+
|Tenant ID|Session Type|       Total Count|       Wait Event Count|       On CPU Count| Avg Active Sessions| % Activity|
+---------+------------+------------------+-----------------------+-------------------+--------------------+-----------+
|     1002|  BACKGROUND|             17350|                   2060|              15290|                0.21|     99.79%|
|     1002|  FOREGROUND|                36|                     22|                 14|                0.00|      0.21%|
+---------+------------+------------------+-----------------------+-------------------+--------------------+-----------+

```

### Top Node Load

这部分显示了 DB time 度量的顶级节点的性能指标。

- IP：服务器 IP 地址。
 - Port：服务器端口号。
 - Session Type：会话类型，可能值包括 BACKGROUND 和 FOREGROUND，分别表示后台进程和前台进程。
 - Total Count：总记录数，表示在 ASH 报告分析时间段内的总样本数。
 - Wait Event Count：等待事件数，表示会话在等待事件上的样本数。
 - On CPU Count：CPU 上的样本数，表示会话在 CPU 上执行的样本数。
 - Avg Active Sessions：平均活跃会话数，表示在采样期间该阶段平均同时有多少数据库会话处于活跃状态（不论是在 CPU 上还是在等待事件）。
 - % Activity：事件的活动百分比，表示给定租户在指定时间段内的活动（CPU + 等待）百分比。

这些信息提供了数据库集群中各个节点的负载相关的性能指标。

```shell
Top Node Load:
  - this section lists top node measured by DB time
  - IP: OceanBase instance svr_ip
  - Port: OceanBase instance svr_port
  - Total Count: num of records during ash report analysis time period
  - Wait Event Count: num of records when session is on wait event
  - On CPU Count: num of records when session is on cpu
  - Avg Active Sessions: average active sessions during ash report analysis time period
  - % Activity: activity(cpu + wait) percentage for given tenant
+----------------+-------+------------+------------------+-----------------------+-------------------+--------------------+-----------+
|              IP|   Port|Session Type|       Total Count|       Wait Event Count|       On CPU Count| Avg Active Sessions| % Activity|
+----------------+-------+------------+------------------+-----------------------+-------------------+--------------------+-----------+
|  xx.xx.xx.xx   |   2882|  BACKGROUND|              7244|                    972|               6272|                0.09|     41.67%|
|  xx.xx.xx.xx   |   2882|  BACKGROUND|              5070|                    555|               4515|                0.06|     29.16%|
|  xx.xx.xx.xx   |   2882|  BACKGROUND|              5036|                    533|               4503|                0.06|     28.97%|
|  xx.xx.xx.xx   |   2882|  FOREGROUND|                35|                     22|                 13|                0.00|      0.20%|
|  xx.xx.xx.xx   |   2882|  FOREGROUND|                 1|                      0|                  1|                0.00|      0.01%|
+----------------+-------+------------+------------------+-----------------------+-------------------+--------------------+-----------+

```

### Top Foreground DB Time

这部分按事件类型列出了数据库前台活动时间的主要消耗者。

- Event Name：消耗 DB Time 最多的事件，既包括等待事件，也包括在 CPU 上的事件。
 - Event Count：每个事件被采样到的会话活动记录的数量。
 - % Activity：事件的活动百分比，表示给定租户在指定时间段内的活动（CPU + 等待）百分比。
 - Avg Active Sessions：平均活跃会话数，表示在采样期间该阶段平均同时有多少数据库会话处于活跃状态（不论是在 CPU 上还是在等待事件）。

这些信息提供了在指定分析周期内，前台会话所消耗 DB Time 排名前列的情况。

```shell
Top Foreground DB Time:
  - this section lists top foreground db time categorized by event
  - Event Name: comprise wait event and on cpu event
  - Event Count: num of sampled session activity records
  - % Activity: activity percentage for given event
  - Avg Active Sessions: average active sessions during ash report analysis time period
+----------------------------------------------------------------+--------------------+-------------+--------------------+-----------+
|                                                      Event Name|          Wait Class|  Event Count| Avg Active Sessions| % Activity|
+----------------------------------------------------------------+--------------------+-------------+--------------------+-----------+
|                                                        sync rpc|             NETWORK|           19|                0.00|      0.11%|
|                                                          ON CPU|                NULL|           14|                0.00|      0.08%|
|                                                      sleep wait|                IDLE|            3|                0.00|      0.02%|
+----------------------------------------------------------------+--------------------+-------------+--------------------+-----------+

```

### Top Execution Phase

这部分显示了执行阶段中占比较高的活动，按会话类型分类，涵盖了 SQL 执行、PL/SQL 处理、存储读写等多个方面。

- Session Type：会话类型，可能值包括 BACKGROUND 和 FOREGROUND，分别表示后台进程和前台进程。
 - Phase of Execution：执行阶段的名称，例如 IN_SQL_EXECUTION（SQL 执行）、IN_COMMITTING（提交过程）、IN_PLSQL_EXECUTION（PL/SQL 执行）等。
 - Count：每个执行阶段发生的次数或记录数。
 - % Activity：事件的活动百分比，表示给定租户在指定时间段内的活动（CPU + 等待）百分比。
 - Avg Active Sessions：平均活跃会话数，表示在采样期间该阶段平均同时有多少数据库会话处于活跃状态（不论是在 CPU 上还是在等待事件）。

这些信息提供了关键执行阶段的活动频次、占用活动比例及平均并发会话情况。

```shell
Top Execution Phase:
  - this section lists top phases of execution, such as SQL, PL/SQL, STORAGE, etc.
+------------+----------------------------------------+----------+-----------+--------------------+
|Session Type|                      Phase of Execution|     Count| % Activity| Avg Active Sessions|
+------------+----------------------------------------+----------+-----------+--------------------+
|  BACKGROUND|                        IN_SQL_EXECUTION|        48|      0.28%|                0.00|
|  BACKGROUND|                           IN_COMMITTING|        15|      0.09%|                0.00|
|  BACKGROUND|                      IN_PLSQL_EXECUTION|        14|      0.08%|                0.00|
|  BACKGROUND|                         IN_STORAGE_READ|         7|      0.04%|                0.00|
|  BACKGROUND|                         IN_SQL_OPTIMIZE|         2|      0.01%|                0.00|
|  BACKGROUND|                    IN_PLSQL_COMPILATION|         2|      0.01%|                0.00|
|  BACKGROUND|                                IN_PARSE|         1|      0.01%|                0.00|
|  FOREGROUND|                        IN_SQL_EXECUTION|        22|      0.13%|                0.00|
|  FOREGROUND|                      IN_PLSQL_EXECUTION|        19|      0.11%|                0.00|
|  FOREGROUND|                    IN_PLSQL_COMPILATION|        17|      0.10%|                0.00|
+------------+----------------------------------------+----------+-----------+--------------------+

```

### Top Background DB Time

这部分显示了后台会话产生的 DB Time。

- Program：后台会话对应的进程名称。
 - Event Name：消耗 DB Time 最多的事件，既包括等待事件，也包括在 CPU 上的事件。
 - Event Count：每个事件被采样到的会话活动记录的数量。
 - % Activity：事件的活动百分比，表示给定租户在指定时间段内的活动（CPU + 等待）百分比。
 - Avg Active Sessions：平均活跃会话数，表示在采样期间该阶段平均同时有多少数据库会话处于活跃状态（不论是在 CPU 上还是在等待事件）。

这些信息提供了最占用资源的后台进程、它们经历的主要事件类型及其活动频率、对整体DB Time的贡献比例，以及并发活跃会话的平均水平。

```shell
Top Background DB Time:
  - this section lists top DB Time for background sessions
  - Program: process name for background sessions
  - Event Name: comprise wait event and on cpu event
  - Event Count: num of sampled session activity records
  - % Activity: activity percentage for given event
  - Avg Active Sessions: average active sessions during ash report analysis time period
+-----------------------------------------------------------------+----------------------------------------------------------------+--------------------+-------------+-----------+--------------------+
|                                                          Program|                                                      Event Name|          Wait Class|  Event Count| % Activity| Avg Active Sessions|
+-----------------------------------------------------------------+----------------------------------------------------------------+--------------------+-------------+-----------+--------------------+
|                                                  T1002_ArcSender|                                                          ON CPU|                NULL|         5959|     34.27%|                0.07|
|                                                  T1002_TenantWea|                                                          ON CPU|                NULL|         1305|      7.51%|                0.02|
|                                                  T1002_LockWaitM|                                                          ON CPU|                NULL|         1236|      7.11%|                0.01|
|                                                   T1002_IOWorker|                                                      palf write|           SYSTEM_IO|          840|      4.83%|                0.01|
|                                                      RPC PROCESS|                               wait for network request in queue|             NETWORK|          637|      3.66%|                0.01|
|                                                      T1002_Occam|                                                          ON CPU|                NULL|          547|      3.15%|                0.01|
|                                                  T1002_TenantInf|                                                          ON CPU|                NULL|          450|      2.59%|                0.01|
|                                                     T1002_PLSSer|                                                          ON CPU|                NULL|          425|      2.44%|                0.01|
|                                   RPC PROCESS (T1002_L5_G0)_1308|                                                          ON CPU|                NULL|          364|      2.09%|                0.00|
|                                                  T1002_TntShared|                                                          ON CPU|                NULL|          361|      2.08%|                0.00|
+-----------------------------------------------------------------+----------------------------------------------------------------+--------------------+-------------+-----------+--------------------+

```

### Top Sessions

这部分显示了顶级会话（Top Sessions）的信息。

- Session ID：采样的会话 ID。
 - Event Name：消耗 DB Time 最多的事件，既包括等待事件，也包括在 CPU 上的事件。
 - Event Count：每个事件被采样到的会话活动记录的数量。
 - % Activity：事件的活动百分比，表示给定租户在指定时间段内的活动（CPU + 等待）百分比。
 - Avg Active Sessions：平均活跃会话数，表示在采样期间该阶段平均同时有多少数据库会话处于活跃状态（不论是在 CPU 上还是在等待事件）。

这些信息提供了以 Session 为维度进行排序统计活跃的 Session。通过采样的会话 ID、活动会话百分比、事件、事件个数、事件百分比，当前用户和采样的活动状态之间的比较，方便找到潜藏的问题 Session。

```shell
Top Sessions:
  - this section lists top Sessions
  - Session ID: user session id
  - Event Name: comprise wait event and on cpu event
  - Event Count: num of sampled session activity records
  - % Activity: activity percentage for given event
  - Avg Active Sessions: average active sessions during ash report analysis time period
+--------------------+----------------------------------------------------------------+----------------------------------------------------------------+--------------------+-------------+-----------+--------------------+
|          Session ID|                                                         Program|                                                      Event Name|          Wait Class|  Event Count| % Activity| Avg Active Sessions|
+--------------------+----------------------------------------------------------------+----------------------------------------------------------------+--------------------+-------------+-----------+--------------------+
|          3221678132|            SQL CMD Query EXEC root@xx.xx.xx.xx    (T1002_L0_G0)|                                                        sync rpc|             NETWORK|            9|      0.05%|                0.00|
|          3221655565|            SQL CMD Query EXEC root@xx.xx.xx.xx    (T1002_L0_G0)|                                                        sync rpc|             NETWORK|            7|      0.04%|                0.00|
|          3221655565|            SQL CMD Query EXEC root@xx.xx.xx.xx    (T1002_L0_G0)|                                                          ON CPU|                NULL|            5|      0.03%|                0.00|
|          3221648823|            SQL CMD Query EXEC root@xx.xx.xx.xx    (T1002_L0_G0)|                                                          ON CPU|                NULL|            3|      0.02%|                0.00|
|          3221648823|            SQL CMD Query EXEC root@xx.xx.xx.xx    (T1002_L0_G0)|                                                        sync rpc|             NETWORK|            3|      0.02%|                0.00|
|          3221741043|            SQL CMD Query EXEC root@xx.xx.xx.xx    (T1002_L0_G0)|                                                          ON CPU|                NULL|            2|      0.01%|                0.00|
|          3221678132|            SQL CMD Query EXEC root@xx.xx.xx.xx    (T1002_L0_G0)|                                                      sleep wait|                IDLE|            2|      0.01%|                0.00|
+--------------------+----------------------------------------------------------------+----------------------------------------------------------------+--------------------+-------------+-----------+--------------------+

```

### Top Groups

这部分显示了资源消耗最大的用户资源管理组（Resource Consumer Groups）。

- Group ID：资源消费组的唯一标识符。
 - Event Name：消耗 DB Time 最多的事件，既包括等待事件，也包括在 CPU 上的事件。
 - Event Count：每个事件被采样到的会话活动记录的数量。
 - % Activity：事件的活动百分比，表示给定租户在指定时间段内的活动（CPU + 等待）百分比。
 - Avg Active Sessions：平均活跃会话数，表示在采样期间该阶段平均同时有多少数据库会话处于活跃状态（不论是在 CPU 上还是在等待事件）。

这些信息提供了顶级资源消费组及其关键性能指标，包括它们遭遇的主要性能事件、事件发生的频繁度、活动占比以及并发会话的平均水平。

```shell
Top Groups:
  - this section lists top resource consumer groups
  - Group ID: resource consumer group id
  - Event Name: comprise wait event and on cpu event
  - Event Count: num of sampled session activity records
  - % Activity: activity percentage for given event
  - Avg Active Sessions: average active sessions during ash report analysis time period
+----------+----------------------------------------------------------------+--------------------+-------------+-----------+--------------------+
|  Group ID|                                                      Event Name|          Wait Class|  Event Count| % Activity| Avg Active Sessions|
+----------+----------------------------------------------------------------+--------------------+-------------+-----------+--------------------+
|         0|                                                          ON CPU|                NULL|        14644|     84.23%|                0.17|
|         0|                                                      palf write|           SYSTEM_IO|          840|      4.83%|                0.01|
|         1|                               wait for network request in queue|             NETWORK|          483|      2.78%|                0.01|
|         1|                                                          ON CPU|                NULL|          445|      2.56%|                0.01|
|         0|                                       slog flush condition wait|         CONCURRENCY|          182|      1.05%|                0.00|
|         2|                                                          ON CPU|                NULL|          174|      1.00%|                0.00|
|         0|                                           db file compact write|           SYSTEM_IO|          166|      0.95%|                0.00|
|         0|                                  async rpc proxy condition wait|             NETWORK|           89|      0.51%|                0.00|
|         0|                               wait for network request in queue|             NETWORK|           71|      0.41%|                0.00|
|         2|                               wait for network request in queue|             NETWORK|           61|      0.35%|                0.00|
+----------+----------------------------------------------------------------+--------------------+-------------+-----------+--------------------+

```

### Top Latchs

这部分显示了数据库中竞争最激烈的 Latch。

- Latch Wait Event：Latch等待事件名称。
 - Event Count：每个事件被采样到的会话活动记录的数量。
 - % Activity：事件的活动百分比，表示给定租户在指定时间段内的活动（CPU + 等待）百分比。
 - Avg Active Sessions：平均活跃会话数，表示在采样期间该阶段平均同时有多少数据库会话处于活跃状态（不论是在 CPU 上还是在等待事件）。

这些信息提供了导致最高等待的 Latch、它们的等待事件计数、活动占比及平均活跃会话数，直接指向了数据库中并发控制的关键瓶颈所在。这些信息对于诊断和解决 Latch 争用问题、减少等待时间、提升系统响应速度及整体性能表现极为关键。

```shell

Top Latchs:
  - this section lists top latches
  - Latch Wait Event: event that waiting for latch
  - Event Count: num of sampled session activity records
  - % Activity: activity percentage for given event
  - Avg Active Sessions: average active sessions during ash report analysis time period
+----------------------------------------------------------------+-------------+-----------+--------------------+
|                                                Latch Wait Event|  Event Count| % Activity| Avg Active Sessions|
+----------------------------------------------------------------+-------------+-----------+--------------------+
+----------------------------------------------------------------+-------------+-----------+--------------------+

```

### Activity Over Time

这部分通过时间间隔的信息展示了分析时段内的数据库活动动态。

- Slot Begin Time：当前时间片的起始时间，每个时间片直到下一个时间片开始时结束
 - Event Name：消耗 DB Time 最多的事件，既包括等待事件，也包括在 CPU 上的事件。
 - Event Count：每个事件被采样到的会话活动记录的数量。
 - % Activity：事件的活动百分比，表示给定租户在指定时间段内的活动（CPU + 等待）百分比。
 - Avg Active Sessions：平均活跃会话数，表示在采样期间该阶段平均同时有多少数据库会话处于活跃状态（不论是在 CPU 上还是在等待事件）。

这些信息提供以时间序列的方式，详细描绘了分析周期内数据库活动的动态变化，包括关键事件的分布、活动强度、资源争用情况随时间的演变。这对于识别性能问题的趋势、高峰期管理、以及制定基于时间维度的性能优化策略提供了宝贵的依据。

```shell
Activity Over Time:
  - this section lists time slot information during the analysis period.
  - Slot Begin Time: current slot's begin time. current slot end with next slot begin time.
  - Event Name: comprise wait event and on cpu event
  - Event Count: num of sampled session activity records
  - % Activity: activity percentage for given event
  - Avg Active Sessions: average active sessions during ash report analysis time period
+----------------------------+----------------------------------------------------------------+--------------------+-------------+-----------+--------------------+
|             Slot Begin Time|                                                      Event Name|          Wait Class|  Event Count| % Activity| Avg Active Sessions|
+----------------------------+----------------------------------------------------------------+--------------------+-------------+-----------+--------------------+
|  2024-06-13 18:20:00.000000|                                                          ON CPU|                NULL|            9|      0.05%|                0.03|
|                            |                                       slog flush condition wait|         CONCURRENCY|            4|      0.02%|                0.01|
|  2024-06-13 18:25:00.000000|                                                          ON CPU|                NULL|           57|      0.33%|                0.19|
|                            |                                       slog flush condition wait|         CONCURRENCY|            2|      0.01%|                0.01|
|                            |                                                      palf write|           SYSTEM_IO|            2|      0.01%|                0.01|
|  2024-06-13 18:30:00.000000|                                                          ON CPU|                NULL|           64|      0.37%|                0.21|
|                            |                               wait for network request in queue|             NETWORK|            2|      0.01%|                0.01|
|  2024-06-13 18:35:00.000000|                                                          ON CPU|                NULL|           62|      0.36%|                0.21|
|                            |                               wait for network request in queue|             NETWORK|            5|      0.03%|                0.02|
|                            |                                                        sync rpc|             NETWORK|            2|      0.01%|                0.01|
|                            |                                                      palf write|           SYSTEM_IO|            2|      0.01%|                0.01|
|  2024-06-13 18:40:00.000000|                                                          ON CPU|                NULL|           55|      0.32%|                0.18|
|                            |                               wait for network request in queue|             NETWORK|            3|      0.02%|                0.01|
|                            |                                  async rpc proxy condition wait|             NETWORK|            2|      0.01%|                0.01|
|  2024-06-13 18:45:00.000000|                                                          ON CPU|                NULL|           62|      0.36%|                0.21|
|                            |                                                      palf write|           SYSTEM_IO|            2|      0.01%|                0.01|
|                            |                                           db file compact write|           SYSTEM_IO|            2|      0.01%|                0.01|
|                            |                                       slog flush condition wait|         CONCURRENCY|            2|      0.01%|                0.01|
|                            |                               wait for network request in queue|             NETWORK|            2|      0.01%|                0.01|
|  2024-06-13 18:50:00.000000|                                                          ON CPU|                NULL|           60|      0.34%|                0.20|
|                            |                                                      palf write|           SYSTEM_IO|            4|      0.02%|                0.01|
|                            |                                  async rpc proxy condition wait|             NETWORK|            3|      0.02%|                0.01|
|                            |                                           db file compact write|           SYSTEM_IO|            2|      0.01%|                0.01|
|                            |                               wait for network request in queue|             NETWORK|            2|      0.01%|                0.01|
|  2024-06-13 18:55:00.000000|                                                          ON CPU|                NULL|           58|      0.33%|                0.19|
|                            |                                                      palf write|           SYSTEM_IO|            9|      0.05%|                0.03|
|                            |                               wait for network request in queue|             NETWORK|            3|      0.02%|                0.01|
|  2024-06-13 19:00:00.000000|                                                          ON CPU|                NULL|           72|      0.41%|                0.24|
|                            |                               wait for network request in queue|             NETWORK|            9|      0.05%|                0.03|
|                            |                                  async rpc proxy condition wait|             NETWORK|            7|      0.04%|                0.02|
|                            |                                                      palf write|           SYSTEM_IO|            5|      0.03%|                0.02|
|  2024-06-13 19:05:00.000000|                                                          ON CPU|                NULL|           72|      0.41%|                0.24|
|                            |                               wait for network request in queue|             NETWORK|            5|      0.03%|                0.02|
+----------------------------+----------------------------------------------------------------+--------------------+-------------+-----------+--------------------+

```

### Top SQL Statement Types

这部分显示了在 ASH 报告分析时段内，按类型统计的最活跃 SQL 语句活动。

- SQL Statement Type：列出了最常执行的 SQL 语句类型，如 SELECT、UPDATE、INSERT 或 DELETE 等。
 - Total Count：给定 SQL 语句类型在整个 ASH 报告分析期间的执行总数。
 - Wait Event Count：当会话处于等待事件状态时，该类型 SQL 的记录数。
 - On CPU Count：该类型 SQL 在会话占用 CPU 执行时的记录数。
 - Avg Active Sessions：平均活跃会话数，表示在采样期间该阶段平均同时有多少数据库会话处于活跃状态（不论是在 CPU 上还是在等待事件）。
 - % Activity：事件的活动百分比，表示给定租户在指定时间段内的活动（CPU + 等待）百分比。

这些信息提供了分类统计 SQL 语句的执行情况，揭示了不同操作类型（如查询、更新）对数据库资源消耗和系统活动的影响。这些数据对于识别高负荷 SQL 类型、优化查询策略、平衡资源分配、以及针对性地进行性能调优具有重要价值。

```shell
Top SQL Statement Types:
  - this section lists top sql statement type.
  - SQL Statement Type: SQL statement types such as SELECT or UPDATE
  - Total Count: num of records during ash report analysis time period
  - Wait Event Count: num of records when session is on wait event
  - On CPU Count: num of records when session is on cpu
  - Avg Active Sessions: average active sessions during ash report analysis time period
  - % Activity: activity(cpu + wait) percentage for given tenant
+---------------------------------------------+------------------+-----------------------+-------------------+--------------------+-----------+
|                           SQL Statement Type|       Total Count|       Wait Event Count|       On CPU Count| Avg Active Sessions| % Activity|
+---------------------------------------------+------------------+-----------------------+-------------------+--------------------+-----------+
|                               T_CREATE_TABLE|                19|                     18|                  1|                0.00|      0.11%|
|                                T_ALTER_TABLE|                 8|                      0|                  8|                0.00|      0.05%|
|                                     T_SELECT|                 5|                      0|                  5|                0.00|      0.03%|
|                              T_DROP_DATABASE|                 3|                      3|                  0|                0.00|      0.02%|
|                             T_CALL_PROCEDURE|                 1|                      1|                  0|                0.00|      0.01%|
+---------------------------------------------+------------------+-----------------------+-------------------+--------------------+-----------+

```

### Top SQL with Top DB Time

这部分显示了在 ASH 报告分析期间，占样本会话活动最高百分比的具体 SQL 语句。

- Plan Hash：代表当前 SQL 执行计划的数值表示，相同的计划会有相同的哈希值。
 - Total Count：给定 SQL 语句类型在整个 ASH 报告分析期间的执行总数。
 - Wait Event Count：当会话处于等待事件状态时，该类型 SQL 的记录数。
 - On CPU Count：该类型 SQL 在会话占用 CPU 执行时的记录数。
 - % Activity：事件的活动百分比，表示给定租户在指定时间段内的活动（CPU + 等待）百分比。

这些信息提供了对 DB Time 消耗影响最大的具体 SQL 语句及其执行特征。它不仅帮助数据库管理员识别出需要优化的关键 SQL，还能通过计划哈希值追溯执行计划的变更，进一步深入到 SQL 执行效率的微观层面进行调优。

```shell
Top SQL with Top DB Time:
  - This Section lists the SQL statements that accounted for the highest percentages of sampled session activity.
  - Plan Hash: Numeric representation of the current SQL plan.
  - Total Count: num of records during ash report analysis time period
  - Wait Event Count: num of records when session is on wait event
  - On CPU Count: num of records when session is on cpu
  - % Activity: activity percentage for given event
+----------------------------------------+--------------------+------------------+-----------------------+-------------------+------------+----------------------------------------------------------------+
|                                  SQL ID|           Plan Hash|       Total Count|       Wait Event Count|       On CPU Count|  % Activity|                                                        SQL Text|
+----------------------------------------+--------------------+------------------+-----------------------+-------------------+------------+----------------------------------------------------------------+
|        1DCD1A13FF867BD1C03DE1582C274EE6| 6388442502389984409|                 4|                      0|                  4|       0.02%|         SELECT DBMS_WORKLOAD_REPOSITORY.ASH_REPORT_TEXT(:0, :1,|
|        1DCD1A13FF867BD1C03DE1582C274EE6| 6388442502389984409|                 4|                      0|                  4|       0.02%|         CALL DBMS_WORKLOAD_REPOSITORY.ASH_REPORT(  '2023-09-22 |
+----------------------------------------+--------------------+------------------+-----------------------+-------------------+------------+----------------------------------------------------------------+

```

### Top SQL with Top Events

这部分显示了与特定顶级事件关联最紧密的 SQL 语句。

- Plan Hash：当前 SQL 执行计划的数值哈希，用于识别 SQL 执行计划的唯一性。
 - Event: 用户事件的名称，包括了一些事件的名称。
 - Event Count：每个事件被采样到的会话活动记录的数量。
 - % Activity：事件的活动百分比，表示给定租户在指定时间段内的活动（CPU + 等待）百分比。

这些信息提供了 SQL 语句执行中导致最高活动占比的具体事件，直接指向了性能瓶颈的核心。通过识别出这些“瓶颈”事件和相关 SQL，数据库管理员可以针对性地优化 SQL 语句、调整执行计划或改善系统配置，以减少等待时间、提高资源利用率。

```shell
Top SQL with Top Events:
  - This Section lists the SQL statements that accounted for the highest percentages event.
  - Plan Hash: Numeric representation of the current SQL plan
  - Event: top event for current SQL plan
  - Event Count: num of samples for top event
  - % Activity: activity percentage for given event
+----------------------------------------+--------------------+----------------------------------------------------------------+--------------+------------+----------------------------------------------------------------+
|                                  SQL ID|           Plan Hash|                                                           Event|   Event Count|  % Activity|                                                        SQL Text|
+----------------------------------------+--------------------+----------------------------------------------------------------+--------------+------------+----------------------------------------------------------------+
|        1DCD1A13FF867BD1C03DE1582C274EE6| 6388442502389984409|                                                          ON CPU|             4|       0.02%|         SELECT DBMS_WORKLOAD_REPOSITORY.ASH_REPORT_TEXT(:0, :1,|
+----------------------------------------+--------------------+----------------------------------------------------------------+--------------+------------+----------------------------------------------------------------+

```

### Top SQL with Top Operator

这部分显示了在执行计划中使用了特定操作符且占据了样本会话活动较高比例的 SQL 语句。

- Plan Hash：当前 SQL 执行计划的哈希数值，用于识别 SQL 执行计划的唯一性。
 - Operator：在当前SQL执行计划中最常出现或最耗资源的操作符。
 - Count：每个执行阶段发生的次数或记录数。
 - % Activity：事件的活动百分比，表示给定租户在指定时间段内的活动（CPU + 等待）百分比。

这些信息提供了与最高活动比例相关的 SQL 操作符，为数据库管理员和开发者提供了优化 SQL 执行路径的精确指引。

```shell
Top SQL with Top Operator:
  - This Section lists the SQL statements that accounted for the highest percentages of sampled session activity with sql operator
  - Plan Hash: Numeric representation of the current SQL plan
  - Operator: top operator name for current SQL plan
  - Count: num of samples for top current SQL operator
  - % Activity: activity percentage for given event
+----------------------------------------+--------------------+--------------------------------------------------------------------------------------------------------------------------------+--------------+--------------+----------------------------------------------------------------+
|                                  SQL ID|           Plan Hash|                                                                                                                        Operator|         Count|    % Activity|                                                        SQL Text|
+----------------------------------------+--------------------+--------------------------------------------------------------------------------------------------------------------------------+--------------+--------------+----------------------------------------------------------------+
|        1DCD1A13FF867BD1C03DE1582C274EE6| 6388442502389984409|                                                                                                                                |             4|         0.02%|         SELECT DBMS_WORKLOAD_REPOSITORY.ASH_REPORT_TEXT(:0, :1,|
|        1DCD1A13FF867BD1C03DE1582C274EE6| 6388442502389984409|                                                                                                                                |             4|         0.02%|         CALL DBMS_WORKLOAD_REPOSITORY.ASH_REPORT(  '2023-09-22 |
+----------------------------------------+--------------------+--------------------------------------------------------------------------------------------------------------------------------+--------------+--------------+----------------------------------------------------------------+

```

### Top PL/SQL Procedures

这部分显示了 Top PL/SQL 存储过程的信息。

- PL/SQL Entry Subprogram: 显示应用程序的顶级 PL/SQL 入口子程序，它可以是过程（procedure）、函数（function）、触发器（trigger）或包的初始化（package initialization）。
 - PL/SQL Current Subprogram: 显示当前正在执行的 PL/SQL 子程序，在采样点时正在执行的 PL/SQL 子程序。如果值为 `SQL`，则表示在特定 PL/SQL 入口子程序中执行 SQL 所占时间的百分比；如果值为 `--`，表示没有具体的子程序执行。
 - % Activity：事件的活动百分比，表示给定租户在指定时间段内的活动（CPU + 等待）百分比。

这些信息提供了有关 Top PL/SQL 存储过程的执行情况，包括顶级入口子程序和当前执行子程序的相关信息以及活动百分比。

```shell
Top PL/SQL Procedures:
  - "PL/SQL Entry Subprogram" represents the application's top-level entry-point(procedure, function, trigger, package initialization) into PL/SQL.
  - "PL/SQL Current Subprogram" is the pl/sql subprogram being executed at the point of sampling . If the value is "SQL", it represents the percentage of time spent executing SQL for the particular plsql entry subprogram.
  - "PL/SQL Entry Subprogram" represents the application's top-level subprogram name
+------------------------------------------------------------+------------------------------------------------------------+--------------------+
|                                      PLSQL Entry Subprogram|                                    PLSQL Current Subprogram|          % Activity|
+------------------------------------------------------------+------------------------------------------------------------+--------------------+
|                                                           .|                                                           -|               0.09%|
|                                                           -|                                                           .|               0.08%|
|                                                           -|                                                           .|               0.01%|
|                                                           -|                                                         SQL|               0.09%|
|                                                           .|                                                           -|               0.04%|
|                                                           -|                                                           .|               0.04%|
|                                                           -|                                                         SQL|               0.04%|
|                                                           .|                                                           -|               0.03%|
|                                                           -|                                                           .|               0.03%|
|                                                           -|                                                         SQL|               0.03%|
|                                                           .|                                                           -|               0.02%|
|                                                           -|                                                           .|               0.02%|
|                                                           -|                                                           .|               0.01%|
|                                                           -|                                                         SQL|               0.02%|
+------------------------------------------------------------+------------------------------------------------------------+--------------------+

```

### Complete List of SQL Text

这部分显示 SQL 文本（SQL Text）的列表，该列表包含了 SQL 查询的 SQL ID 和 SQL 查询的文本信息。

- SQL ID: SQL 查询的唯一标识符。
 - SQL Text: SQL 查询的文本。

这些信息提供了关于 SQL 查询列表，可以用于识别、分析和优化查询性能。

```shell
Complete List of SQL Text:
  SQL ID: E828C9647CCA3FC0E94A9117C8A28A46
SQL Text: create table dup_part_zero(c1 int, c2 int, c3 longtext, index(c1) local, index(c2) global) duplicate_scope = 'cluster'

  SQL ID: 1DCD1A13FF867BD1C03DE1582C274EE6
SQL Text: CALL DBMS_WORKLOAD_REPOSITORY.ASH_REPORT(  '2023-09-22 10:26:47',  '2024-06-22 20:27:07' )

  SQL ID: 1DCD1A13FF867BD1C03DE1582C274EE6
SQL Text: SELECT DBMS_WORKLOAD_REPOSITORY.ASH_REPORT_TEXT(:0, :1,:2,:3,:4, :6, :7, :8, LOWER(:5)) AS REPORT

  SQL ID: E040EE778B7D6089C672F8A39E378AE9
SQL Text: INSERT INTO __all_column_usage(tenant_id,table_id,column_id,equality_preds,equijoin_preds,nonequijion_preds,range_preds,like_preds,null_preds,distinct_member,groupby_member,flags) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?

  SQL ID: 8D67BCF7B67A397C590C4173B8AA7160
SQL Text: drop database mwx

  SQL ID: 63094A5D530AA167DC53930A30C383ED
SQL Text: create table dup_part_five(c1 int, c2 int, c3 longtext, index(c1) local, index(c2) global) duplicate_scope = 'cluster'

  SQL ID: 948C3E3C7B0A265A3FFB574BC37D8558
SQL Text: create table dup_part_three(c1 int, c2 int, c3 longtext, index(c1) local, index(c2) global) duplicate_scope = 'cluster'

  SQL ID: D3711121823630566148389A5434F5CC
SQL Text: create table dup_part_two(c1 int, c2 int, c3 longtext, index(c1) local, index(c2) global) duplicate_scope = 'cluster'

  SQL ID: CF05F891D761DB9505D1EA76FDB29165
SQL Text: INSERT INTO __all_column_usage(tenant_id,table_id,column_id,equality_preds,equijoin_preds,nonequijion_preds,range_preds,like_preds,null_preds,distinct_member,groupby_member,flags) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?),(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)ON DUPLICATE KEY UPDATE equality_preds = equality_preds + if (values(flags) & ?, ?, ?),equijoin_preds = equijoin_preds + if (values(flags) & ?, ?, ?),nonequijion_preds = nonequijion_preds + if (values(flags) &

  SQL ID: 175EFE9FDD277AA4CBB1EC93AAA622F1
SQL Text: drop database info

```

### 完整报告展示

完整的 ASH 报告显示如下：

Top Active Tenants:
  - this section lists top active tenant information
  - Total Count: num of records during ash report analysis time period
  - Wait Event Count: num of records when session is on wait event
  - On CPU Count: num of records when session is on cpu
  - Avg Active Sessions: average active sessions during ash report analysis time period
  - % Activity: activity(cpu + wait) percentage for given tenant
+---------+------------+------------------+-----------------------+-------------------+--------------------+-----------+
|Tenant ID|Session Type|       Total Count|       Wait Event Count|       On CPU Count| Avg Active Sessions| % Activity|
+---------+------------+------------------+-----------------------+-------------------+--------------------+-----------+
|     1002|  BACKGROUND|             17350|                   2060|              15290|                0.21|     99.79%|
|     1002|  FOREGROUND|                36|                     22|                 14|                0.00|      0.21%|
+---------+------------+------------------+-----------------------+-------------------+--------------------+-----------+

Top Node Load:
  - this section lists top node measured by DB time
  - IP: OceanBase instance svr_ip
  - Port: OceanBase instance svr_port
  - Total Count: num of records during ash report analysis time period
  - Wait Event Count: num of records when session is on wait event
  - On CPU Count: num of records when session is on cpu
  - Avg Active Sessions: average active sessions during ash report analysis time period
  - % Activity: activity(cpu + wait) percentage for given tenant
+----------------+-------+------------+------------------+-----------------------+-------------------+--------------------+-----------+
|              IP|   Port|Session Type|       Total Count|       Wait Event Count|       On CPU Count| Avg Active Sessions| % Activity|
+----------------+-------+------------+------------------+-----------------------+-------------------+--------------------+-----------+
|  xx.xx.xx.xx   |   2882|  BACKGROUND|              7244|                    972|               6272|                0.09|     41.67%|
|  xx.xx.xx.xx   |   2882|  BACKGROUND|              5070|                    555|               4515|                0.06|     29.16%|
|  xx.xx.xx.xx   |   2882|  BACKGROUND|              5036|                    533|               4503|                0.06|     28.97%|
|  xx.xx.xx.xx   |   2882|  FOREGROUND|                35|                     22|                 13|                0.00|      0.20%|
|  xx.xx.xx.xx   |   2882|  FOREGROUND|                 1|                      0|                  1|                0.00|      0.01%|
+----------------+-------+------------+------------------+-----------------------+-------------------+--------------------+-----------+

Top Foreground DB Time:
  - this section lists top foreground db time categorized by event
  - Event Name: comprise wait event and on cpu event
  - Event Count: num of sampled session activity records
  - % Activity: activity percentage for given event
  - Avg Active Sessions: average active sessions during ash report analysis time period
+----------------------------------------------------------------+--------------------+-------------+--------------------+-----------+
|                                                      Event Name|          Wait Class|  Event Count| Avg Active Sessions| % Activity|
+----------------------------------------------------------------+--------------------+-------------+--------------------+-----------+
|                                                        sync rpc|             NETWORK|           19|                0.00|      0.11%|
|                                                          ON CPU|                NULL|           14|                0.00|      0.08%|
|                                                      sleep wait|                IDLE|            3|                0.00|      0.02%|
+----------------------------------------------------------------+--------------------+-------------+--------------------+-----------+

Top Execution Phase:
  - this section lists top phases of execution, such as SQL, PL/SQL, STORAGE, etc.
+------------+----------------------------------------+----------+-----------+--------------------+
|Session Type|                      Phase of Execution|     Count| % Activity| Avg Active Sessions|
+------------+----------------------------------------+----------+-----------+--------------------+
|  BACKGROUND|                        IN_SQL_EXECUTION|        48|      0.28%|                0.00|
|  BACKGROUND|                           IN_COMMITTING|        15|      0.09%|                0.00|
|  BACKGROUND|                      IN_PLSQL_EXECUTION|        14|      0.08%|                0.00|
|  BACKGROUND|                         IN_STORAGE_READ|         7|      0.04%|                0.00|
|  BACKGROUND|                         IN_SQL_OPTIMIZE|         2|      0.01%|                0.00|
|  BACKGROUND|                    IN_PLSQL_COMPILATION|         2|      0.01%|                0.00|
|  BACKGROUND|                                IN_PARSE|         1|      0.01%|                0.00|
|  FOREGROUND|                        IN_SQL_EXECUTION|        22|      0.13%|                0.00|
|  FOREGROUND|                      IN_PLSQL_EXECUTION|        19|      0.11%|                0.00|
|  FOREGROUND|                    IN_PLSQL_COMPILATION|        17|      0.10%|                0.00|
+------------+----------------------------------------+----------+-----------+--------------------+

Top Background DB Time:
  - this section lists top DB Time for background sessions
  - Program: process name for background sessions
  - Event Name: comprise wait event and on cpu event
  - Event Count: num of sampled session activity records
  - % Activity: activity percentage for given event
  - Avg Active Sessions: average active sessions during ash report analysis time period
+-----------------------------------------------------------------+----------------------------------------------------------------+--------------------+-------------+-----------+--------------------+
|                                                          Program|                                                      Event Name|          Wait Class|  Event Count| % Activity| Avg Active Sessions|
+-----------------------------------------------------------------+----------------------------------------------------------------+--------------------+-------------+-----------+--------------------+
|                                                  T1002_ArcSender|                                                          ON CPU|                NULL|         5959|     34.27%|                0.07|
|                                                  T1002_TenantWea|                                                          ON CPU|                NULL|         1305|      7.51%|                0.02|
|                                                  T1002_LockWaitM|                                                          ON CPU|                NULL|         1236|      7.11%|                0.01|
|                                                   T1002_IOWorker|                                                      palf write|           SYSTEM_IO|          840|      4.83%|                0.01|
|                                                      RPC PROCESS|                               wait for network request in queue|             NETWORK|          637|      3.66%|                0.01|
|                                                      T1002_Occam|                                                          ON CPU|                NULL|          547|      3.15%|                0.01|
|                                                  T1002_TenantInf|                                                          ON CPU|                NULL|          450|      2.59%|                0.01|
|                                                     T1002_PLSSer|                                                          ON CPU|                NULL|          425|      2.44%|                0.01|
|                                   RPC PROCESS (T1002_L5_G0)_1308|                                                          ON CPU|                NULL|          364|      2.09%|                0.00|
|                                                  T1002_TntShared|                                                          ON CPU|                NULL|          361|      2.08%|                0.00|
+-----------------------------------------------------------------+----------------------------------------------------------------+--------------------+-------------+-----------+--------------------+

Top Sessions:
  - this section lists top Sessions
  - Session ID: user session id
  - Event Name: comprise wait event and on cpu event
  - Event Count: num of sampled session activity records
  - % Activity: activity percentage for given event
  - Avg Active Sessions: average active sessions during ash report analysis time period
+--------------------+----------------------------------------------------------------+----------------------------------------------------------------+--------------------+-------------+-----------+--------------------+
|          Session ID|                                                         Program|                                                      Event Name|          Wait Class|  Event Count| % Activity| Avg Active Sessions|
+--------------------+----------------------------------------------------------------+----------------------------------------------------------------+--------------------+-------------+-----------+--------------------+
|          3221678132|            SQL CMD Query EXEC root@xx.xx.xx.xx    (T1002_L0_G0)|                                                        sync rpc|             NETWORK|            9|      0.05%|                0.00|
|          3221655565|            SQL CMD Query EXEC root@xx.xx.xx.xx    (T1002_L0_G0)|                                                        sync rpc|             NETWORK|            7|      0.04%|                0.00|
|          3221655565|            SQL CMD Query EXEC root@xx.xx.xx.xx    (T1002_L0_G0)|                                                          ON CPU|                NULL|            5|      0.03%|                0.00|
|          3221648823|            SQL CMD Query EXEC root@xx.xx.xx.xx    (T1002_L0_G0)|                                                          ON CPU|                NULL|            3|      0.02%|                0.00|
|          3221648823|            SQL CMD Query EXEC root@xx.xx.xx.xx    (T1002_L0_G0)|                                                        sync rpc|             NETWORK|            3|      0.02%|                0.00|
|          3221741043|            SQL CMD Query EXEC root@xx.xx.xx.xx    (T1002_L0_G0)|                                                          ON CPU|                NULL|            2|      0.01%|                0.00|
|          3221678132|            SQL CMD Query EXEC root@xx.xx.xx.xx    (T1002_L0_G0)|                                                      sleep wait|                IDLE|            2|      0.01%|                0.00|
+--------------------+----------------------------------------------------------------+----------------------------------------------------------------+--------------------+-------------+-----------+--------------------+

Top Groups:
  - this section lists top resource consumer groups
  - Group ID: resource consumer group id
  - Event Name: comprise wait event and on cpu event
  - Event Count: num of sampled session activity records
  - % Activity: activity percentage for given event
  - Avg Active Sessions: average active sessions during ash report analysis time period
+----------+----------------------------------------------------------------+--------------------+-------------+-----------+--------------------+
|  Group ID|                                                      Event Name|          Wait Class|  Event Count| % Activity| Avg Active Sessions|
+----------+----------------------------------------------------------------+--------------------+-------------+-----------+--------------------+
|         0|                                                          ON CPU|                NULL|        14644|     84.23%|                0.17|
|         0|                                                      palf write|           SYSTEM_IO|          840|      4.83%|                0.01|
|         1|                               wait for network request in queue|             NETWORK|          483|      2.78%|                0.01|
|         1|                                                          ON CPU|                NULL|          445|      2.56%|                0.01|
|         0|                                       slog flush condition wait|         CONCURRENCY|          182|      1.05%|                0.00|
|         2|                                                          ON CPU|                NULL|          174|      1.00%|                0.00|
|         0|                                           db file compact write|           SYSTEM_IO|          166|      0.95%|                0.00|
|         0|                                  async rpc proxy condition wait|             NETWORK|           89|      0.51%|                0.00|
|         0|                               wait for network request in queue|             NETWORK|           71|      0.41%|                0.00|
|         2|                               wait for network request in queue|             NETWORK|           61|      0.35%|                0.00|
+----------+----------------------------------------------------------------+--------------------+-------------+-----------+--------------------+

Activity Over Time:
  - this section lists time slot information during the analysis period.
  - Slot Begin Time: current slot's begin time. current slot end with next slot begin time.
  - Event Name: comprise wait event and on cpu event
  - Event Count: num of sampled session activity records
  - % Activity: activity percentage for given event
  - Avg Active Sessions: average active sessions during ash report analysis time period
+----------------------------+----------------------------------------------------------------+--------------------+-------------+-----------+--------------------+
|             Slot Begin Time|                                                      Event Name|          Wait Class|  Event Count| % Activity| Avg Active Sessions|
+----------------------------+----------------------------------------------------------------+--------------------+-------------+-----------+--------------------+
|  2024-06-13 18:20:00.000000|                                                          ON CPU|                NULL|            9|      0.05%|                0.03|
|                            |                                       slog flush condition wait|         CONCURRENCY|            4|      0.02%|                0.01|
|  2024-06-13 18:25:00.000000|                                                          ON CPU|                NULL|           57|      0.33%|                0.19|
|                            |                                       slog flush condition wait|         CONCURRENCY|            2|      0.01%|                0.01|
|                            |                                                      palf write|           SYSTEM_IO|            2|      0.01%|                0.01|
|  2024-06-13 18:30:00.000000|                                                          ON CPU|                NULL|           64|      0.37%|                0.21|
|                            |                               wait for network request in queue|             NETWORK|            2|      0.01%|                0.01|
|  2024-06-13 18:35:00.000000|                                                          ON CPU|                NULL|           62|      0.36%|                0.21|
|                            |                               wait for network request in queue|             NETWORK|            5|      0.03%|                0.02|
|                            |                                                        sync rpc|             NETWORK|            2|      0.01%|                0.01|
|                            |                                                      palf write|           SYSTEM_IO|            2|      0.01%|                0.01|
|  2024-06-13 18:40:00.000000|                                                          ON CPU|                NULL|           55|      0.32%|                0.18|
|                            |                               wait for network request in queue|             NETWORK|            3|      0.02%|                0.01|
|                            |                                  async rpc proxy condition wait|             NETWORK|            2|      0.01%|                0.01|
|  2024-06-13 18:45:00.000000|                                                          ON CPU|                NULL|           62|      0.36%|                0.21|
|                            |                                                      palf write|           SYSTEM_IO|            2|      0.01%|                0.01|
|                            |                                           db file compact write|           SYSTEM_IO|            2|      0.01%|                0.01|
|                            |                                       slog flush condition wait|         CONCURRENCY|            2|      0.01%|                0.01|
|                            |                               wait for network request in queue|             NETWORK|            2|      0.01%|                0.01|
|  2024-06-13 18:50:00.000000|                                                          ON CPU|                NULL|           60|      0.34%|                0.20|
|                            |                                                      palf write|           SYSTEM_IO|            4|      0.02%|                0.01|
|                            |                                  async rpc proxy condition wait|             NETWORK|            3|      0.02%|                0.01|
|                            |                                           db file compact write|           SYSTEM_IO|            2|      0.01%|                0.01|
|                            |                               wait for network request in queue|             NETWORK|            2|      0.01%|                0.01|
|  2024-06-13 18:55:00.000000|                                                          ON CPU|                NULL|           58|      0.33%|                0.19|
|                            |                                                      palf write|           SYSTEM_IO|            9|      0.05%|                0.03|
|                            |                               wait for network request in queue|             NETWORK|            3|      0.02%|                0.01|
|  2024-06-13 19:00:00.000000|                                                          ON CPU|                NULL|           72|      0.41%|                0.24|
|                            |                               wait for network request in queue|             NETWORK|            9|      0.05%|                0.03|
|                            |                                  async rpc proxy condition wait|             NETWORK|            7|      0.04%|                0.02|
|                            |                                                      palf write|           SYSTEM_IO|            5|      0.03%|                0.02|
|  2024-06-13 19:05:00.000000|                                                          ON CPU|                NULL|           72|      0.41%|                0.24|
|                            |                               wait for network request in queue|             NETWORK|            5|      0.03%|                0.02|
+----------------------------+----------------------------------------------------------------+--------------------+-------------+-----------+--------------------+

Top SQL Statement Types:
  - this section lists top sql statement type.
  - SQL Statement Type: SQL statement types such as SELECT or UPDATE
  - Total Count: num of records during ash report analysis time period
  - Wait Event Count: num of records when session is on wait event
  - On CPU Count: num of records when session is on cpu
  - Avg Active Sessions: average active sessions during ash report analysis time period
  - % Activity: activity(cpu + wait) percentage for given tenant
+---------------------------------------------+------------------+-----------------------+-------------------+--------------------+-----------+
|                           SQL Statement Type|       Total Count|       Wait Event Count|       On CPU Count| Avg Active Sessions| % Activity|
+---------------------------------------------+------------------+-----------------------+-------------------+--------------------+-----------+
|                               T_CREATE_TABLE|                19|                     18|                  1|                0.00|      0.11%|
|                                T_ALTER_TABLE|                 8|                      0|                  8|                0.00|      0.05%|
|                                     T_SELECT|                 5|                      0|                  5|                0.00|      0.03%|
|                              T_DROP_DATABASE|                 3|                      3|                  0|                0.00|      0.02%|
|                             T_CALL_PROCEDURE|                 1|                      1|                  0|                0.00|      0.01%|
+---------------------------------------------+------------------+-----------------------+-------------------+--------------------+-----------+

Top SQL with Top DB Time:
  - This Section lists the SQL statements that accounted for the highest percentages of sampled session activity.
  - Plan Hash: Numeric representation of the current SQL plan.
  - Total Count: num of records during ash report analysis time period
  - Wait Event Count: num of records when session is on wait event
  - On CPU Count: num of records when session is on cpu
  - % Activity: activity percentage for given event
+----------------------------------------+--------------------+------------------+-----------------------+-------------------+------------+----------------------------------------------------------------+
|                                  SQL ID|           Plan Hash|       Total Count|       Wait Event Count|       On CPU Count|  % Activity|                                                        SQL Text|
+----------------------------------------+--------------------+------------------+-----------------------+-------------------+------------+----------------------------------------------------------------+
|        1DCD1A13FF867BD1C03DE1582C274EE6| 6388442502389984409|                 4|                      0|                  4|       0.02%|         SELECT DBMS_WORKLOAD_REPOSITORY.ASH_REPORT_TEXT(:0, :1,|
|        1DCD1A13FF867BD1C03DE1582C274EE6| 6388442502389984409|                 4|                      0|                  4|       0.02%|         CALL DBMS_WORKLOAD_REPOSITORY.ASH_REPORT(  '2023-09-22 |
+----------------------------------------+--------------------+------------------+-----------------------+-------------------+------------+----------------------------------------------------------------+

Top SQL with Top Events:
  - This Section lists the SQL statements that accounted for the highest percentages event.
  - Plan Hash: Numeric representation of the current SQL plan
  - Event: top event for current SQL plan
  - Event Count: num of samples for top event
  - % Activity: activity percentage for given event
+----------------------------------------+--------------------+----------------------------------------------------------------+--------------+------------+----------------------------------------------------------------+
|                                  SQL ID|           Plan Hash|                                                           Event|   Event Count|  % Activity|                                                        SQL Text|
+----------------------------------------+--------------------+----------------------------------------------------------------+--------------+------------+----------------------------------------------------------------+
|        1DCD1A13FF867BD1C03DE1582C274EE6| 6388442502389984409|                                                          ON CPU|             4|       0.02%|         SELECT DBMS_WORKLOAD_REPOSITORY.ASH_REPORT_TEXT(:0, :1,|
+----------------------------------------+--------------------+----------------------------------------------------------------+--------------+------------+----------------------------------------------------------------+

Top SQL with Top Operator:
  - This Section lists the SQL statements that accounted for the highest percentages of sampled session activity with sql operator
  - Plan Hash: Numeric representation of the current SQL plan
  - Operator: top operator name for current SQL plan
  - Count: num of samples for top current SQL operator
  - % Activity: activity percentage for given event
+----------------------------------------+--------------------+--------------------------------------------------------------------------------------------------------------------------------+--------------+--------------+----------------------------------------------------------------+
|                                  SQL ID|           Plan Hash|                                                                                                                        Operator|         Count|    % Activity|                                                        SQL Text|
+----------------------------------------+--------------------+--------------------------------------------------------------------------------------------------------------------------------+--------------+--------------+----------------------------------------------------------------+
|        1DCD1A13FF867BD1C03DE1582C274EE6| 6388442502389984409|                                                                                                                                |             4|         0.02%|         SELECT DBMS_WORKLOAD_REPOSITORY.ASH_REPORT_TEXT(:0, :1,|
|        1DCD1A13FF867BD1C03DE1582C274EE6| 6388442502389984409|                                                                                                                                |             4|         0.02%|         CALL DBMS_WORKLOAD_REPOSITORY.ASH_REPORT(  '2023-09-22 |
+----------------------------------------+--------------------+--------------------------------------------------------------------------------------------------------------------------------+--------------+--------------+----------------------------------------------------------------+

Top PL/SQL Procedures:
  - "PL/SQL Entry Subprogram" represents the application's top-level entry-point(procedure, function, trigger, package initialization) into PL/SQL.
  - "PL/SQL Current Subprogram" is the pl/sql subprogram being executed at the point of sampling . If the value is "SQL", it represents the percentage of time spent executing SQL for the particular plsql entry subprogram.
  - "PL/SQL Entry Subprogram" represents the application's top-level subprogram name
+------------------------------------------------------------+------------------------------------------------------------+--------------------+
|                                      PLSQL Entry Subprogram|                                    PLSQL Current Subprogram|          % Activity|
+------------------------------------------------------------+------------------------------------------------------------+--------------------+
|                                                           .|                                                           -|               0.09%|
|                                                           -|                                                           .|               0.08%|
|                                                           -|                                                           .|               0.01%|
|                                                           -|                                                         SQL|               0.09%|
|                                                           .|                                                           -|               0.04%|
|                                                           -|                                                           .|               0.04%|
|                                                           -|                                                         SQL|               0.04%|
|                                                           .|                                                           -|               0.03%|
|                                                           -|                                                           .|               0.03%|
|                                                           -|                                                         SQL|               0.03%|
|                                                           .|                                                           -|               0.02%|
|                                                           -|                                                           .|               0.02%|
|                                                           -|                                                           .|               0.01%|
|                                                           -|                                                         SQL|               0.02%|
+------------------------------------------------------------+------------------------------------------------------------+--------------------+

Complete List of SQL Text:
  SQL ID: E828C9647CCA3FC0E94A9117C8A28A46
SQL Text: create table dup_part_zero(c1 int, c2 int, c3 longtext, index(c1) local, index(c2) global) duplicate_scope = 'cluster'

```

## 相关等待事件

根据 [常见的等待事件](https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000001033318) 查询各等待事件表示的含义，方便您在分析报告时，快速的定位问题，

## 相关文档

- [ASH 简介](https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000001034103)。
 - [生成 ASH 报告](https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000001034105)。

 上一篇 下一篇 ![有帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*y6ocSqN8cqsAAAAAAAAAAAAAARQnAQ)![无帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*BG9IQJyLHF8AAAAAAAAAAAAAARQnAQ)![反馈](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*eTWdQKCRKHwAAAAAAAAAAAAAARQnAQ)[AI](https://www.oceanbase.com/obi) 咨询热线
