Note
This view is introduced since OceanBase Database V4.0.0.
Purpose
The GV$OB_COMPACTION_PROGRESS view displays the progress of OBServer node-level compactions in the current tenant.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| SVR_IP | VARCHAR2(46) | NO | The IP address of the OBServer node. |
| SVR_PORT | NUMBER(38) | NO | The port number of the OBServer node. |
| TENANT_ID | NUMBER(38) | NO | The ID of the tenant. |
| TYPE | VARCHAR2(64) | NO | The compaction type. Valid values:
|
| ZONE | VARCHAR2(128) | NO | The zone. |
| COMPACTION_SCN | NUMBER(38) | NO | Version information of the major compactions |
| STATUS | VARCHAR2(15) | NO | The status information. |
| TOTAL_TABLET_COUNT | NUMBER(38) | NO | The total number of tablets. |
| UNFINISHED_TABLET_COUNT | NUMBER(38) | NO | The number of unfinished tablets. |
| DATA_SIZE | NUMBER(38) | NO | The total amount of data to be scanned, in bytes. |
| UNFINISHED_DATA_SIZE | NUMBER(38) | NO | The number of bytes of data not yet to be scanned |
| COMPRESSION_RATIO | NUMBER(38) | NO | The compression ratio of the data that has been written since the last major compaction version. |
| START_TIME | TIMESTAMP(6) WITH LOCAL TIME ZONE | NO | The start time. |
| ESTIMATED_FINISH_TIME | TIMESTAMP(6) WITH LOCAL TIME ZONE | NO | The estimated completion time. If COMPACTION_PROGRESS is displayed as 100, the compaction end time is displayed. |
| COMMENTS | VARCHAR2(1024) | NO | The comments are recorded for the current latest Compaction event during major compactions. They also record the overall major compaction time when major compactions are completed. |
Sample query
In a user tenant, query the major compaction progress on all nodes for this tenant.
obclient [SYS]> SELECT * FROM SYS.GV$OB_COMPACTION_PROGRESS;
The query results are as follows:
+----------------+----------+-----------+-------------+-------+---------------------+--------+--------------------+-------------------------+-----------+----------------------+-------------------+------------------------------+------------------------------+--------------------------------------------------------------+
| SVR_IP | SVR_PORT | TENANT_ID | TYPE | ZONE | COMPACTION_SCN | STATUS | TOTAL_TABLET_COUNT | UNFINISHED_TABLET_COUNT | DATA_SIZE | UNFINISHED_DATA_SIZE | COMPRESSION_RATIO | START_TIME | ESTIMATED_FINISH_TIME | COMMENTS |
+----------------+----------+-----------+-------------+-------+---------------------+--------+--------------------+-------------------------+-----------+----------------------+-------------------+------------------------------+------------------------------+--------------------------------------------------------------+
| 172.xx.xxx.xxx | 2882 | 1004 | MAJOR_MERGE | zone1 | 1735668003058920000 | FINISH | 2 | 0 | 0 | 0 | 1 | 01-JAN-25 02.00.03.770432 AM | 01-JAN-25 02.02.16.903124 AM | total=6.93ms; |
| 172.xx.xxx.xxx | 2882 | 1004 | MAJOR_MERGE | zone1 | 1735754404488391000 | FINISH | 2 | 0 | 0 | 0 | 1 | 02-JAN-25 02.00.07.115160 AM | 02-JAN-25 02.02.20.064100 AM | total=5.81ms; |
| 172.xx.xxx.xxx | 2882 | 1004 | MAJOR_MERGE | zone1 | 1735668003058920000 | FINISH | 661 | 0 | 20751544 | 0 | 1 | 01-JAN-25 02.00.03.665963 AM | 01-JAN-25 02.04.23.476557 AM | EXECUTE=1.45s|(0.35)|UPDATE_TABLET=2.39s|(0.58)|total=4.11s; |
| 172.xx.xxx.xxx | 2882 | 1004 | MAJOR_MERGE | zone1 | 1735754404488391000 | FINISH | 661 | 0 | 166968863 | 0 | 1 | 02-JAN-25 02.00.07.328724 AM | 02-JAN-25 02.04.47.311077 AM | EXECUTE=1.31s|(0.40)|UPDATE_TABLET=1.73s|(0.53)|total=3.28s; |
| 172.xx.xxx.xxx | 2882 | 1004 | MAJOR_MERGE | zone1 | 1735840800964965000 | FINISH | 661 | 0 | 170954155 | 0 | 1 | 03-JAN-25 02.00.01.025371 AM | 03-JAN-25 02.05.11.332273 AM | EXECUTE=1.39s|(0.40)|UPDATE_TABLET=1.80s|(0.52)|total=3.45s; |
| 172.xx.xxx.xxx | 2882 | 1004 | MAJOR_MERGE | zone1 | 1735668003058920000 | FINISH | 2 | 0 | 0 | 0 | 1 | 01-JAN-25 02.00.03.759582 AM | 01-JAN-25 02.02.17.255535 AM | total=6.15ms; |
| 172.xx.xxx.xxx | 2882 | 1004 | MAJOR_MERGE | zone1 | 1735754404488391000 | FINISH | 2 | 0 | 0 | 0 | 1 | 02-JAN-25 02.00.07.111225 AM | 02-JAN-25 02.02.20.630775 AM | total=8.01ms; |
| 172.xx.xxx.xxx | 2882 | 1004 | MAJOR_MERGE | zone1 | 1735840800964965000 | FINISH | 2 | 0 | 0 | 0 | 1 | 03-JAN-25 02.00.03.989795 AM | 03-JAN-25 02.02.24.016779 AM | total=7.76ms; |
+----------------+----------+-----------+-------------+-------+---------------------+--------+--------------------+-------------------------+-----------+----------------------+-------------------+------------------------------+------------------------------+--------------------------------------------------------------+
8 rows in set