Note
This view is available starting with V4.0.0.
Purpose
This view displays the major compaction information of each zone for all tenants under the sys tenant.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | NO | The tenant ID. |
| ZONE | varchar(128) | NO | The zone name. |
| BROADCAST_SCN | bigint(20) unsigned | NO | The version number of the broadcast major compaction. |
| LAST_SCN | bigint(20) unsigned | NO | The version number of the last 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 |
|
Sample query
Query the major compaction information of each zone for all tenants under the sys tenant.
obclient> SELECT * FROM oceanbase.CDB_OB_ZONE_MAJOR_COMPACTION;
The query result is as follows:
+-----------+-------+---------------------+---------------------+----------------------------+----------------------------+--------+
| TENANT_ID | ZONE | BROADCAST_SCN | LAST_SCN | LAST_FINISH_TIME | START_TIME | STATUS |
+-----------+-------+---------------------+---------------------+----------------------------+----------------------------+--------+
| 1 | zone1 | 1748368801021617000 | 1748368801021617000 | 2025-05-28 02:04:15.351286 | 2025-05-28 02:00:01.051592 | IDLE |
| 1001 | zone1 | 1748368802924607000 | 1748368802924607000 | 2025-05-28 02:02:16.412661 | 2025-05-28 02:00:02.965810 | IDLE |
| 1002 | zone1 | 1748368802035321000 | 1748368802035321000 | 2025-05-28 02:03:25.019173 | 2025-05-28 02:00:02.090687 | IDLE |
| 1003 | zone1 | 1748368802977311000 | 1748368802977311000 | 2025-05-28 02:02:46.565036 | 2025-05-28 02:00:03.009192 | IDLE |
| 1004 | zone1 | 1748368801786323000 | 1748368801786323000 | 2025-05-28 02:03:54.629630 | 2025-05-28 02:00:01.820863 | IDLE |
+-----------+-------+---------------------+---------------------+----------------------------+----------------------------+--------+
5 rows in set
References
Query the global major compaction information of all tenants: CDB_OB_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 operations related to major compactions, see the following topics: