GV$OB_OPT_STAT_GATHER_MONITOR

2025-11-14 07:33:33  Updated

Note

This view is introduced since OceanBase Database V4.2.0.

Purpose

This view displays the real-time status of statistics collection tasks for all OBServer nodes in the current tenant.

Columns

Column Type Nullable? Description
TENANT_ID NUMBER NO The ID of the tenant to which the collection task belongs.
SVR_IP VARCHAR2(46) NO The IP address of the OBServer node where the collection task resides.
SVR_PORT NUMBER NO The port number of the OBServer node where the collection task resides.
SESSION_ID NUMBER NO The ID of the session to which the collection task belongs.
For V4.3.x:
  • Before V4.3.5 BP2:
    In all connection modes (direct mode/ODP mode), this field indicates the server session ID.
  • V4.3.5 BP2 and later versions:
    • In direct mode:
      This field indicates the server session ID.
    • In ODP mode:
      • When the ODP parameter client_session_id_version = 2 is set, this field indicates the client session ID.
      • When client_session_id_version = 1, this field indicates the server session ID.
TRACE_ID VARCHAR2(64) NO The ID of the trace to which the collection task belongs.
TASK_ID VARCHAR2(36) NO The ID of the collection task, which is generated based on the universally unique identifier (UUID) and is globally unique.
TYPE VARCHAR2(16) NO The type of the collection task.
TASK_START_TIME TIMESTAMP(6) NO The start time of the collection task.
TASK_DURATION_TIME NUMBER NO The duration of the collection task, in microseconds.
TASK_TABLE_COUNT NUMBER NO The number of tables whose statistics need to be collected by the collection task.
COMPLETED_TABLE_COUNT NUMBER NO The number of tables whose statistics have been collected by the collection task.
RUNNING_TABLE_OWNER VARCHAR2(128) NO The username of the owner of the table whose statistics are being collected by the collection task.
RUNNING_TABLE_NAME VARCHAR2(256) NO The name of the table whose statistics are being collected by the collection task.
RUNNING_TABLE_DURATION_TIME VARCHAR2(256) NO The duration that has been taken by the collection task to collect statistics of the table.

Sample query

Query the real-time status of statistics collection tasks in all nodes of the user tenant.

obclient> SELECT * FROM SYS.GV$OB_OPT_STAT_GATHER_MONITOR;

The query result is as follows:

+-----------+----------------+----------+------------+-----------------------------------+--------------------------------------+---------------+----------------------------+--------------------+------------------+-----------------------+---------------------+--------------------+-----------------------------+
| TENANT_ID | SVR_IP         | SVR_PORT | SESSION_ID | TRACE_ID                          | TASK_ID                              | TYPE          | TASK_START_TIME            | TASK_DURATION_TIME | TASK_TABLE_COUNT | COMPLETED_TABLE_COUNT | RUNNING_TABLE_OWNER | RUNNING_TABLE_NAME | RUNNING_TABLE_DURATION_TIME |
+-----------+----------------+----------+------------+-----------------------------------+--------------------------------------+---------------+----------------------------+--------------------+------------------+-----------------------+---------------------+--------------------+-----------------------------+
|      1006 | xxx.xxx.xxx.xx |     2882 | 3221575784 | YB42AC1E87C6-0005FF6AD9F825FB-0-0 | c921f339-1bc8-11ee-a7ea-52583362494c | MANUAL GATHER | 2023-07-06 14:46:07.691856 |             609652 |                1 |                     0 | test                | t1                 |                      609653 |
+-----------+----------------+----------+------------+-----------------------------------+--------------------------------------+---------------+----------------------------+--------------------+------------------+-----------------------+---------------------+--------------------+-----------------------------+
1 row in set

References

Contact Us