OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Database

SQL - V4.1.0

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogLive DemosTraining & Certification
    Company
    About OceanBaseTrust CenterLegalPartnerContact Us
    Follow Us

    © OceanBase 2026. All rights reserved

    Cloud Service AgreementPrivacy PolicySecurity
    Contact Us
    Document Feedback
    1. Documentation Center
    2. OceanBase Database
    3. SQL
    4. V4.1.0
    iconOceanBase Database
    SQL - V 4.1.0
    SQL
    KV
    • V 4.4.2
    • V 4.3.5
    • V 4.3.3
    • V 4.3.1
    • V 4.3.0
    • V 4.2.5
    • V 4.2.2
    • V 4.2.1
    • V 4.2.0
    • V 4.1.0
    • V 4.0.0
    • V 3.1.4 and earlier

    View minor compaction information

    Last Updated:2025-12-09 07:09:36  Updated
    share
    What is on this page
    View the minor compaction progress
    View the minor compaction history

    folded

    share

    After you initiate a minor compaction, you can query the minor compaction progress and history in views.

    View the minor compaction progress

    1. Log on to the sys tenant of the cluster as the root user.

    2. View the progress information such as the amount of data that has not been compacted and the estimated completion time.

      The GV$OB_TABLET_COMPACTION_PROGRESS view displays progress information of only ongoing tablet-level compaction tasks but not completed tasks. Query syntax:

      obclient> SELECT * FROM oceanbase.GV$OB_TABLET_COMPACTION_PROGRESS WHERE TYPE='MINI_MERGE'\G;
      *************************** 1. row ***************************
                            SVR_IP: xx.xx.xx.xx
                          SVR_PORT: 2401
                         TENANT_ID: 1002
                              TYPE: MINI_MERGE
                             LS_ID: 1001
                         TABLET_ID: 1152921504606847235
                    COMPACTION_SCN: 1680514780195130031
                           TASK_ID: Y9610BA2DA3E-0005F7FD6E1FE0FF-0-0
                            STATUS: NODE_RUNNING
                         DATA_SIZE: 31890729
              UNFINISHED_DATA_SIZE: 3351030
      PROGRESSIVE_COMPACTION_ROUND: 1
                       CREATE_TIME: 2023-04-03 17:49:17.278506
                        START_TIME: 2023-04-03 17:51:57.953999
             ESTIMATED_FINISH_TIME: 2023-04-03 23:32:25.969930
      1 row in set
      

      Fields in the query result:

      • TYPE: the type of the compaction task. Valid values:

        • MINOR_MERGE: indicates a minor merge task that compacts multiple mini SSTables into a minor SSTable.

        • MINI_MERGE: indicates a minor compaction task that freezes and flushes the MemTable into a mini SSTable.

        • MEDIUM_MERGE: indicates a partition-level major compaction.

        • MAJOR_MERGE: indicates a major compaction.

        • META_MAJOR_MERGE: indicates a buffer table-level major compaction.

      • STATUS: the status of the compaction task. The value NODE_RUNNING indicates that the compaction task is running.

      • DATA_SIZE: the total amount of data to be compacted.

      • UNFINISHED_DATA_SIZE: the amount of data that has not been compacted.

      • ESTIMATED_FINISH_TIME: the estimated completion time.

      For more information about fields in the GV$OB_TABLET_COMPACTION_PROGRESS view, see GV$OB_TABLET_COMPACTION_PROGRESS.

      If a tablet does not appear in this view or the minor compaction remains unfinished for a tablet after a long period of time, you can query the GV$OB_COMPACTION_DIAGNOSE_INFO view to verify whether an exception occurs.

      For more information about fields in the GV$OB_COMPACTION_DIAGNOSE_INFO view, see GV$OB_COMPACTION_DIAGNOSE_INFO.

    View the minor compaction history

    1. Log on to the sys tenant of the cluster as the root user.

    2. View the minor compaction history.

      The GV$OB_TABLET_COMPACTION_HISTORY view displays the tablet-level compaction history. Query syntax:

      obclient [oceanbase]> SELECT * FROM oceanbase.GV$OB_TABLET_COMPACTION_HISTORY WHERE TYPE='MINI_MERGE' TABLET_ID=200001\G
      *************************** 1. row ***************************
                                       SVR_IP: xx.xx.xx.xx
                                     SVR_PORT: 2882
                                    TENANT_ID: 1002
                                        LS_ID: 1001
                                    TABLET_ID: 200001
                                         TYPE: MINI_MERGE
                               COMPACTION_SCN: 1680142515939965301
                                   START_TIME: 2023-03-30 10:15:20.433070
                                  FINISH_TIME: 2023-03-30 10:15:20.433444
                                      TASK_ID: YB42AC1E87CC-0005F7EE202A5810-0-0
                                  OCCUPY_SIZE: 0
                            MACRO_BLOCK_COUNT: 0
                MULTIPLEXED_MACRO_BLOCK_COUNT: 0
                 NEW_MICRO_COUNT_IN_NEW_MACRO: 0
         MULTIPLEXED_MICRO_COUNT_IN_NEW_MACRO: 0
                              TOTAL_ROW_COUNT: 0
                        INCREMENTAL_ROW_COUNT: 0
                            COMPRESSION_RATIO: 1
                          NEW_FLUSH_DATA_RATE: 0
                 PROGRESSIVE_COMPACTION_ROUND: 0
                   PROGRESSIVE_COMPACTION_NUM: 0
                              PARALLEL_DEGREE: 1
                                PARALLEL_INFO: -
                            PARTICIPANT_TABLE: table_cnt=1,start_scn=1,end_scn=1680142515939965301;
                                MACRO_ID_LIST:
                                     COMMENTS: time_guard=EXECUTE=892us|(0.49)|UPDATE_TABLET=605us|(0.33)|total=1.82ms;
      *************************** 2. row ***************************
                                       SVR_IP: xx.xx.xx.xx
                                     SVR_PORT: 2882
                                    TENANT_ID: 1002
                                        LS_ID: 1001
                                    TABLET_ID: 200001
                                         TYPE: MINI_MERGE
                               COMPACTION_SCN: 1680199217439878616
                                   START_TIME: 2023-03-31 02:00:21.835832
                                  FINISH_TIME: 2023-03-31 02:00:21.836314
                                      TASK_ID: YB42AC1E87CC-0005F7EE202A5C53-0-0
                                  OCCUPY_SIZE: 0
                            MACRO_BLOCK_COUNT: 0
                MULTIPLEXED_MACRO_BLOCK_COUNT: 0
                 NEW_MICRO_COUNT_IN_NEW_MACRO: 0
         MULTIPLEXED_MICRO_COUNT_IN_NEW_MACRO: 0
                              TOTAL_ROW_COUNT: 0
                        INCREMENTAL_ROW_COUNT: 0
                            COMPRESSION_RATIO: 1
                          NEW_FLUSH_DATA_RATE: 0
                 PROGRESSIVE_COMPACTION_ROUND: 0
                   PROGRESSIVE_COMPACTION_NUM: 0
                              PARALLEL_DEGREE: 1
                                PARALLEL_INFO: -
                            PARTICIPANT_TABLE: table_cnt=1,start_scn=1680142515939965301,end_scn=1680199217439878616;
                                MACRO_ID_LIST:
                                     COMMENTS: new_medium_list:{cnt=1;1680199204727259164}|time_guard=EXECUTE=629us|(0.39)|UPDATE_TABLET=696us|(0.43)|total=1.61ms;
      *************************** 3. row ***************************
                                       SVR_IP: xx.xx.xx.xx
                                     SVR_PORT: 2882
                                    TENANT_ID: 1002
                                        LS_ID: 1001
                                    TABLET_ID: 200001
                                         TYPE: MINI_MERGE
                               COMPACTION_SCN: 1680285613573143617
                                   START_TIME: 2023-04-01 02:00:14.248500
                                  FINISH_TIME: 2023-04-01 02:00:14.248823
                                      TASK_ID: YB42AC1E87CC-0005F7EE202A5F84-0-0
                                  OCCUPY_SIZE: 0
                            MACRO_BLOCK_COUNT: 0
                MULTIPLEXED_MACRO_BLOCK_COUNT: 0
                 NEW_MICRO_COUNT_IN_NEW_MACRO: 0
         MULTIPLEXED_MICRO_COUNT_IN_NEW_MACRO: 0
                              TOTAL_ROW_COUNT: 0
                        INCREMENTAL_ROW_COUNT: 0
                            COMPRESSION_RATIO: 1
                          NEW_FLUSH_DATA_RATE: 0
                 PROGRESSIVE_COMPACTION_ROUND: 0
                   PROGRESSIVE_COMPACTION_NUM: 0
                              PARALLEL_DEGREE: 1
                                PARALLEL_INFO: -
                            PARTICIPANT_TABLE: table_cnt=1,start_scn=1680199217439878616,end_scn=1680285613573143617;
                                MACRO_ID_LIST:
                                     COMMENTS: new_medium_list:{cnt=1;1680285601108938417}|time_guard=EXECUTE=528us|(0.22)|UPDATE_TABLET=1.58ms|(0.64)|total=2.45ms;
      *************************** 4. row ***************************
                                       SVR_IP: xx.xx.xx.xx
                                     SVR_PORT: 2882
                                    TENANT_ID: 1002
                                        LS_ID: 1001
                                    TABLET_ID: 200001
                                         TYPE: MINI_MERGE
                               COMPACTION_SCN: 1680372014559392064
                                   START_TIME: 2023-04-02 02:00:16.549722
                                  FINISH_TIME: 2023-04-02 02:00:16.550169
                                      TASK_ID: YB42AC1E87CC-0005F7EE202A640F-0-0
                                  OCCUPY_SIZE: 0
                            MACRO_BLOCK_COUNT: 0
                MULTIPLEXED_MACRO_BLOCK_COUNT: 0
                 NEW_MICRO_COUNT_IN_NEW_MACRO: 0
         MULTIPLEXED_MICRO_COUNT_IN_NEW_MACRO: 0
                              TOTAL_ROW_COUNT: 0
                        INCREMENTAL_ROW_COUNT: 0
                            COMPRESSION_RATIO: 1
                          NEW_FLUSH_DATA_RATE: 0
                 PROGRESSIVE_COMPACTION_ROUND: 0
                   PROGRESSIVE_COMPACTION_NUM: 0
                              PARALLEL_DEGREE: 1
                                PARALLEL_INFO: -
                            PARTICIPANT_TABLE: table_cnt=1,start_scn=1680285613573143617,end_scn=1680372014559392064;
                                MACRO_ID_LIST:
                                     COMMENTS: new_medium_list:{cnt=1;1680372002531630824}|time_guard=EXECUTE=635us|(0.47)|UPDATE_TABLET=476us|(0.35)|total=1.35ms;
      *************************** 5. row ***************************
                                       SVR_IP: xx.xx.xx.xx
                                     SVR_PORT: 2882
                                    TENANT_ID: 1002
                                        LS_ID: 1001
                                    TABLET_ID: 200001
                                         TYPE: MINI_MERGE
                               COMPACTION_SCN: 1680458416863471713
                                   START_TIME: 2023-04-03 02:00:18.737260
                                  FINISH_TIME: 2023-04-03 02:00:18.737475
                                      TASK_ID: YB42AC1E87CC-0005F7EE202A6851-0-0
                                  OCCUPY_SIZE: 0
                            MACRO_BLOCK_COUNT: 0
                MULTIPLEXED_MACRO_BLOCK_COUNT: 0
                 NEW_MICRO_COUNT_IN_NEW_MACRO: 0
         MULTIPLEXED_MICRO_COUNT_IN_NEW_MACRO: 0
                              TOTAL_ROW_COUNT: 0
                        INCREMENTAL_ROW_COUNT: 0
                            COMPRESSION_RATIO: 1
                          NEW_FLUSH_DATA_RATE: 0
                 PROGRESSIVE_COMPACTION_ROUND: 0
                   PROGRESSIVE_COMPACTION_NUM: 0
                              PARALLEL_DEGREE: 1
                                PARALLEL_INFO: -
                            PARTICIPANT_TABLE: table_cnt=1,start_scn=1680372014559392064,end_scn=1680458416863471713;
                                MACRO_ID_LIST:
                                     COMMENTS: new_medium_list:{cnt=1;1680458404011443372}|time_guard=EXECUTE=334us|(0.46)|CREATE_SSTABLE=125us|(0.17)|UPDATE_TABLET=173us|(0.24)|total=733us;
      5 rows in set
      

    Previous topic

    Manually initiate a minor compaction
    Last

    Next topic

    Modify minor compaction settings
    Next
    What is on this page
    View the minor compaction progress
    View the minor compaction history