Note
This view is available starting with V4.0.0.
Purpose
This view displays the global compaction information of all tenants under the sys tenant.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | NO | The tenant ID. |
| FROZEN_SCN | bigint(20) unsigned | NO | The version number of the last major compaction. |
| FROZEN_TIME | timestamp(6) | NO | The start time of the last major compaction. (FROZEN_SCN is displayed in a readable format.) |
| GLOBAL_BROADCAST_SCN | bigint(20) unsigned | NO | The global broadcast version of the major compaction. |
| LAST_SCN | bigint(20) unsigned | NO | The version number of the last completed major compaction. |
| 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 | IDLE: No major compaction is in progress.COMPACTION: A major compaction is in progress.CHECKSUM: Checksum verification is in progress. |
| IS_ERROR | varchar(3) | NO | YES: An error occurred during the major compaction.NO: No error occurred during the major compaction. |
| IS_SUSPENDED | varchar(3) | NO | YES: The major compaction is suspended.NO: The major compaction is not suspended. |
| INFO | varchar(14) | NO | The information about the major compaction. For example, the reason why the major compaction failed. |
Sample query
Query the global 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 compaction information of all tenants under each zone: CDB_OB_ZONE_MAJOR_COMPACTION
Query the basic statistics of major compactions at the tablet level:
Query the detailed historical information about major compactions at the tablet level:
For more information about major compactions, see the following topics: