Note
This view is available starting with V4.0.0.
Purpose
This view displays the global compaction information of all tenants in 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 time when the last major compaction was initiated. (This field displays FROZEN_SCN 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 completed major compaction. |
| LAST_FINISH_TIME | timestamp(6) | NO | The time when the last major compaction was completed. |
| START_TIME | timestamp(6) | NO | The time when the major compaction started. |
| STATUS | varchar(10) | NO | IDLE: No major compaction is in progress.COMPACTION: A major compaction is in progress.CHECKSUM: The checksum is being verified. |
| 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 compaction information. For example, the reason for the failure. |
Sample query
Query the global compaction information of all tenants in the sys tenant.
obclient [oceanbase]> 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 | 1736359201793995000 | 2025-01-09 02:00:01.793995 | 1736359201793995000 | 1736359201793995000 | 2025-01-09 02:05:56.738721 | 2025-01-09 02:00:01.822737 | IDLE | NO | NO | |
| 1001 | 1736359204148730000 | 2025-01-09 02:00:04.148730 | 1736359204148730000 | 1736359204148730000 | 2025-01-09 02:02:38.682242 | 2025-01-09 02:00:04.176391 | IDLE | NO | NO | |
| 1002 | 1736359203243332000 | 2025-01-09 02:00:03.243332 | 1736359203243332000 | 1736359203243332000 | 2025-01-09 02:02:26.912138 | 2025-01-09 02:00:03.270335 | IDLE | NO | NO | |
| 1003 | 1736359202785343000 | 2025-01-09 02:00:02.785343 | 1736359202785343000 | 1736359202785343000 | 2025-01-09 02:04:06.924096 | 2025-01-09 02:00:02.807081 | IDLE | NO | NO | |
| 1004 | 1736359202149291000 | 2025-01-09 02:00:02.149291 | 1736359202149291000 | 1736359202149291000 | 2025-01-09 02:03:45.486421 | 2025-01-09 02:00:02.174093 | IDLE | NO | NO | |
| 1009 | 1736359203939785000 | 2025-01-09 02:00:03.939785 | 1736359203939785000 | 1736359203939785000 | 2025-01-09 02:02:38.476264 | 2025-01-09 02:00:03.961791 | IDLE | NO | NO | |
| 1010 | 1736359203089228000 | 2025-01-09 02:00:03.089228 | 1736359203089228000 | 1736359203089228000 | 2025-01-09 02:02:46.819113 | 2025-01-09 02:00:03.120682 | IDLE | NO | NO | |
| 1015 | 1736359202029840000 | 2025-01-09 02:00:02.029840 | 1736359202029840000 | 1736359202029840000 | 2025-01-09 02:03:26.119103 | 2025-01-09 02:00:02.054206 | IDLE | NO | NO | |
| 1016 | 1736359203243332000 | 2025-01-09 02:00:03.243332 | 1736359203243332000 | 1736359203243332000 | 2025-01-09 02:05:33.693375 | 2025-01-09 02:01:59.454704 | IDLE | NO | NO | |
+-----------+---------------------+----------------------------+----------------------+---------------------+----------------------------+----------------------------+--------+----------+--------------+------+
9 rows in set
References
Query the global compaction information of all tenants: CDB_OB_ZONE_MAJOR_COMPACTION
Query the basic statistics of major compactions at the tablet level:
Query the detailed historical information of major compactions at the tablet level:
For information about major compactions, see the following topics: