Note
This view is available starting with V4.0.0.
Purpose
This view displays the global major compaction information of all tenants under the sys tenant.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | NO | The ID of the tenant. |
| FROZEN_SCN | bigint(20) unsigned | NO | The version number of the last major compaction. |
| FROZEN_TIME | timestamp(6) | NO | The time when the last major compaction was initiated. (FROZEN_SCN is displayed in a readable format.) |
| GLOBAL_BROADCAST_SCN | bigint(20) unsigned | NO | The version number of the global broadcast major compaction. |
| LAST_SCN | bigint(20) unsigned | NO | The version number of the last major compaction that was completed. |
| LAST_FINISH_TIME | timestamp(6) | NO | The end time of the last major compaction. |
| START_TIME | timestamp(6) | NO | The start time of the major compaction. |
| STATUS | varchar(10) | NO |
|
| IS_ERROR | varchar(3) | NO |
|
| IS_SUSPENDED | varchar(3) | NO |
|
| INFO | varchar(14) | NO | The information about the major compaction. For example, the reason for the major compaction failure. |
Sample query
Query the global major compaction information of all tenants under the sys tenant.
obclient> SELECT * FROM oceanbase.CDB_OB_MAJOR_COMPACTION;
The query result is as follows:
+-----------+---------------------+----------------------------+----------------------+---------------------+----------------------------+----------------------------+--------+----------+--------------+------+
| TENANT_ID | FROZEN_SCN | FROZEN_TIME | GLOBAL_BROADCAST_SCN | LAST_SCN | LAST_FINISH_TIME | START_TIME | STATUS | IS_ERROR | IS_SUSPENDED | INFO |
+-----------+---------------------+----------------------------+----------------------+---------------------+----------------------------+----------------------------+--------+----------+--------------+------+
| 1 | 1748455203800778000 | 2025-05-29 02:00:03.800778 | 1748455203800778000 | 1748455203800778000 | 2025-05-29 02:08:07.209651 | 2025-05-29 02:00:03.823428 | IDLE | NO | NO | |
| 1001 | 1748455201648062000 | 2025-05-29 02:00:01.648062 | 1748455201648062000 | 1748455201648062000 | 2025-05-29 02:07:54.983179 | 2025-05-29 02:00:01.671665 | IDLE | NO | NO | |
| 1002 | 1748455203748142000 | 2025-05-29 02:00:03.748142 | 1748455203748142000 | 1748455203748142000 | 2025-05-29 02:05:55.876675 | 2025-05-29 02:00:03.770352 | IDLE | NO | NO | |
| 1003 | 1748455203288928000 | 2025-05-29 02:00:03.288928 | 1748455203288928000 | 1748455203288928000 | 2025-05-29 02:07:56.498676 | 2025-05-29 02:00:03.314133 | IDLE | NO | NO | |
| 1004 | 1748455200327759000 | 2025-05-29 02:00:00.327759 | 1748455200327759000 | 1748455200327759000 | 2025-05-29 02:06:12.483698 | 2025-05-29 02:00:00.351135 | IDLE | NO | NO | |
+-----------+---------------------+----------------------------+----------------------+---------------------+----------------------------+----------------------------+--------+----------+--------------+------+
5 rows in set
References
Query the global major compaction information of all tenants in each zone: CDB_OB_ZONE_MAJOR_COMPACTION
Query the tablet-level basic statistics of major compactions:
Query the detailed historical information of major compactions at the tablet level:
For more information about major compactions, see the following topics: