Note
This view is introduced since OceanBase Database V4.2.0.
Purpose
The DBA_OB_TASK_OPT_STAT_GATHER_HISTORY view displays the execution information about historical collection tasks.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| TENANT_ID | NUMBER | NO | The ID of the tenant to which the collection task belongs. |
| TASK_ID | VARCHAR2(36) | NO | The ID of the collection task, which is generated based on UUID and is globally unique. |
| TYPE | VARCHAR2(16) | NO | The type of the collection task. |
| STATUS | VARCHAR2(8) | NO | The status of the collection task. Valid values:
|
| TASK_TABLE_COUNT | NUMBER | YES | The number of tables whose statistics need to be collected by the collection task. |
| FAILED_COUNT | NUMBER | YES | The number of tables whose statistics failed to be collected by the collection task. |
| TASK_START_TIME | TIMESTAMP(6) | NO | The start time of the collection task. |
| TASK_END_TIME | TIMESTAMP(6) | NO | The end time of the collection task. |
Sample query
In a user tenant, query the execution status of historical collection tasks of the tenant.
obclient> SELECT * FROM SYS.DBA_OB_TASK_OPT_STAT_GATHER_HISTORY;
The query result is as follows:
+-----------+--------------------------------------+---------------+---------+-------------+--------------+----------------------------+----------------------------+
| TENANT_ID | TASK_ID | TYPE | STATUS | TABLE_COUNT | FAILED_COUNT | START_TIME | END_TIME |
+-----------+--------------------------------------+---------------+---------+-------------+--------------+----------------------------+----------------------------+
| 1006 | 12551575-1a73-11ee-97fa-0eac862eb0b0 | AUTO GATHER | SUCCESS | 28 | 0 | 2023-07-04 22:00:00.669344 | 2023-07-04 22:00:06.636230 |
| 1006 | 32163b43-1bc9-11ee-a7ea-52583362494c | MANUAL GATHER | SUCCESS | 1 | 0 | 2023-07-06 14:49:03.775825 | 2023-07-06 14:49:05.729871 |
| 1006 | 44783d8c-1b3c-11ee-8ac6-d28f59026246 | AUTO GATHER | SUCCESS | 19 | 0 | 2023-07-05 22:00:00.767591 | 2023-07-05 22:00:22.035235 |
| 1006 | a1487d0e-185a-11ee-8ac6-d28f59026246 | AUTO GATHER | SUCCESS | 304 | 0 | 2023-07-02 06:00:00.673996 | 2023-07-02 06:00:29.273704 |
| 1006 | c921f339-1bc8-11ee-a7ea-52583362494c | MANUAL GATHER | SUCCESS | 1 | 0 | 2023-07-06 14:46:07.691856 | 2023-07-06 14:46:09.712585 |
| 1006 | db64f8b8-1bc5-11ee-a7ea-52583362494c | MANUAL GATHER | SUCCESS | 1 | 0 | 2023-07-06 14:25:09.839887 | 2023-07-06 14:25:12.686117 |
| 1006 | e7dc9678-19a9-11ee-95a7-2646ab385e11 | AUTO GATHER | SUCCESS | 23 | 0 | 2023-07-03 22:00:00.596163 | 2023-07-03 22:00:05.079117 |
+-----------+--------------------------------------+---------------+---------+-------------+--------------+----------------------------+----------------------------+
7 rows in set
References
- View the status of table-level historical statistics collection: DBA_OB_TABLE_OPT_STAT_GATHER_HISTORY
For more information about monitoring diagnostics for statistics collection, see Monitoring diagnostics for statistics collection.