OceanBase logo

OceanBase

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

Product Overview
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

OceanBase

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

Product Overview
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.4.2

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogLive DemosTraining & CertificationTicket
    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.4.2
    iconOceanBase Database
    SQL - V 4.4.2
    Databases
    • OceanBase Database
    • OceanBase Cloud
    • OceanBase Tugraph
    • Interactive Tutorials
    • OceanBase Best Practices
    Tools
    • OceanBase Cloud Platform
    • OceanBase Migration Service
    • OceanBase Developer Center
    • OceanBase Migration Assessment
    • OceanBase Admin Tool
    • OceanBase Loader and Dumper
    • OceanBase Deployer
    • Kubernetes operator for OceanBase
    • OceanBase Diagnostic Tool
    • OceanBase Binlog Service
    Connectors and Middleware
    • OceanBase Database Proxy
    • Embedded SQL in C for OceanBase
    • OceanBase Call Interface
    • OceanBase Connector/C
    • OceanBase Connector/J
    • OceanBase Connector/ODBC
    • OceanBase Connector/NET
    SQL
    KV
    • V 4.6.0
    • 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

    V$OB_TABLET_COMPACTION_HISTORY

    Last Updated:2026-05-11 03:53:53  Updated
    Share
    What is on this page
    Purpose
    Columns
    Sample query
    References

    folded

    Share

    Note

    This view is introduced in V4.0.0.

    Purpose

    The V$OB_TABLET_COMPACTION_HISTORY view displays the historical information about tablet-level compactions.

    Columns

    Column
    Type
    Nullable?
    Description
    SVR_IP VARCHAR2(46) NO The IP address of the server.
    SVR_PORT NUMBER(38) NO The port number of the server.
    TENANT_ID NUMBER(38) NO The tenant ID.
    LS_ID NUMBER(38) NO The log stream ID.
    TABLET_ID NUMBER(38) NO The data tablet ID.
    TYPE VARCHAR2(64) NO The type of compaction. Valid values:
    • MDS_TABLE_MERGE: persists the system metadata to disk in the format of an SSTable.
    • MAJOR_MERGE: major compaction for a tenant.
    • MEDIUM_MERGE: major compaction for a partition.
    • MINI_MERGE: converts the MemTables to Mini SSTables.
    • MINOR_MERGE: combines multiple Mini SSTables into one, or combines multiple Mini SSTables and one Minor SSTable into one Minor SSTable.
    • META_MAJOR_MERGE: a special type of compaction that compiles data before a specified time point into one Meta Major SSTable. The data format of a Meta Major SSTable is the same as that of a Major SSTable, but it does not contain multi-version data or uncommitted transaction data.
    COMPACTION_SCN NUMBER(38) NO The version of the compaction. For minor compactions, this field records the snapshot_version.
    START_TIME TIMESTAMP(6) WITH LOCAL TIME ZONE NO The start time.
    FINISH_TIME TIMESTAMP(6) WITH LOCAL TIME ZONE NO The end time.
    OCCUPY_SIZE NUMBER(38) NO The data volume.
    MACRO_BLOCK_COUNT NUMBER(38) NO The number of macroblocks.
    MULTIPLEXED_MACRO_BLOCK_COUNT NUMBER(38) NO The number of reused macroblocks.
    NEW_MICRO_COUNT_IN_NEW_MACRO NUMBER(38) NO The number of new microblocks in a new macroblock.
    MULTIPLEXED_MICRO_COUNT_IN_NEW_MACRO NUMBER(38) NO The number of reused microblocks in a new macroblock.
    TOTAL_ROW_COUNT NUMBER(38) NO The total number of rows.
    INCREMENTAL_ROW_COUNT NUMBER(38) NO The number of new output rows.
    COMPRESSION_RATIO NUMBER(38) NO The compression ratio of the new data: the size of the new data after compression divided by the size of the new data before compression.
    PROGRESSIVE_COMPACTION_ROUND NUMBER(38) NO The progressive compaction round. If the compaction is a full compaction, this field records -1.
    PROGRESSIVE_COMPACTION_NUM NUMBER(38) NO The total number of progressive compaction rounds.
    PARALLEL_DEGREE NUMBER(38) NO The degree of parallelism.
    PARALLEL_INFO VARCHAR2(512) NO The information about parallel tasks, including the minimum, maximum, and average values of the data scanned, runtime, and data output.
    MACRO_ID_LIST varchar2(256) NO The output macroblock list. The list is not displayed if it is too long.
    COMMENTS varchar2(256) NO Records the history of failed compactions and collects the time consumption of the current compaction.
    START_CG_ID NUMBER(38) NO The start ID of the column group.

    Note

    This field is introduced in V4.3.0.

    END_CG_ID NUMBER(38) NO The end ID of the column group.

    Note

    This field is introduced in V4.3.0.

    KEPT_SNAPSHOT VARCHAR2(128) NO The information about multi-version snapshots retained in this compaction.

    Note

    This field is introduced in V4.3.0.

    MERGE_LEVEL VARCHAR2(64) NO Indicates whether major compaction and microblock reuse are used in this compaction.

    Note

    This field is introduced in V4.3.0.

    EXEC_MODE VARCHAR2(64) NO The mode of this compaction trace. Valid values:
    • EXEC_MODE_LOCAL: local mode. Macroblocks are output to the local disk.
    • EXEC_MODE_VALIDATE: shared mode. Only checksums are calculated. Macroblocks are not output. This mode is currently not supported.
    • EXEC_MODE_OUTPUT: shared mode. Macroblocks are output to shared storage. This mode is currently not supported.

    Note

    This field is introduced in V4.3.3.

    IS_FULL_MERGE VARCHAR2(5) NO Indicates whether this is a full compaction.

    Note

    This field is introduced in V4.3.3.

    IO_COST_TIME_PERCENTAGE NUMBER(38) NO The percentage of I/O time in the total compaction time.

    Note

    This field is introduced in V4.3.3.

    MERGE_REASON VARCHAR2(32) NO The reason for initiating the compaction. Valid values:
    • LOAD_DATA_SCENE: data loading scenario.
    • TOMBSTONE_SCENE: tombstone scenario.
    • INEFFICIENT_QUERY: slow query scenario.
    • FREQUENT_WRITE: frequent write scenario.
    • TENANT_MAJOR: tenant-level compaction.
    • USER_REQUEST: user-initiated compaction.
    • REBUILD_COLUMN_GROUP: row-to-column conversion scenario.

    Note

    This field is introduced in V4.3.3.

    BASE_MAJOR_STATUS VARCHAR2(64) NO The type of the Major SSTable before the compaction. Valid values:
    • COL_WITH_ALL: defined as a hybrid row-column store table, and the baseline data is stored in hybrid row-column stores.
    • COL_ONLY_ALL: defined as a hybrid row-column store table, and the baseline data is adaptively optimized to be stored in row stores only.
    • PURE_COL: defined as a columnar store table, and the baseline data is stored in columnar stores.
    • PURE_COL_ONLY_ALL: defined as a columnar store table, and the baseline data is adaptively optimized to be stored in row stores only.
    • ROW_STORE_MAJOR: a row store table.

    Note

    This field is introduced in V4.3.3.

    CO_MERGE_TYPE VARCHAR2(64) NO The type of columnar store compaction. Valid values:
    • BUILD_COLUMN_STORE_MERGE: the data is converted to a columnar store.
    • BUILD_ROW_STORE_MERGE: the data is converted to a row store.
    • USE_RS_BUILD_SCHEMA_MATCH_MERGE: the data is converted to a store type that matches the schema.

    Note

    This field is introduced in V4.3.3.

    MDS_FILTER_INFO VARCHAR2(1024) NO This view displays the MDS filter information used for major compaction.

    Note

    This field was introduced in V4.3.5 and takes effect starting from V4.3.5 BP2.

    EXECUTE_TIME NUMBER(38) NO The time consumed by the major compaction task for CPU, in microseconds.

    Note

    This field is introduced in V4.3.5 BP3.

    Sample query

    The following example shows how to view the historical information about tablet-level compactions on this OBServer node.

    obclient [SYS]> SELECT * FROM SYS.V$OB_TABLET_COMPACTION_HISTORY WHERE ROWNUM = 1\G
    

    The query result is as follows:

    *************************** 1. row ***************************
                                  SVR_IP: 172.xx.xxx.xxx
                                SVR_PORT: 2882
                               TENANT_ID: 1004
                                   LS_ID: 1
                               TABLET_ID: 60379
                                    TYPE: MAJOR_MERGE
                          COMPACTION_SCN: 1750701602970025000
                              START_TIME: 24-JUN-25 02.03.53.830276 AM
                             FINISH_TIME: 24-JUN-25 02.03.53.840954 AM
                                 TASK_ID: YB42AC1E87D9-00063837DFD7BB62-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: 1
              PROGRESSIVE_COMPACTION_NUM: 0
                         PARALLEL_DEGREE: 1
                           PARALLEL_INFO: -
                       PARTICIPANT_TABLE: table_cnt=1,[MAJOR]snapshot_version=1;
                           MACRO_ID_LIST: NULL
                                COMMENTS: NULL
                             START_CG_ID: 0
                               END_CG_ID: 0
                           KEPT_SNAPSHOT: {type:"UNDO_RETENTION", snapshot:1750700023151746000}
                             MERGE_LEVEL: MICRO_BLOCK_LEVEL
                               EXEC_MODE: EXEC_MODE_LOCAL
                           IS_FULL_MERGE: FALSE
                 IO_COST_TIME_PERCENTAGE: 0
                            MERGE_REASON: TENANT_MAJOR
                       BASE_MAJOR_STATUS: NULL
                           CO_MERGE_TYPE: NULL
                         MDS_FILTER_INFO: NULL
                            EXECUTE_TIME: 684
    1 row in set
    

    References

    • GV$OB_TABLET_COMPACTION_HISTORY

    • V$OB_TABLET_COMPACTION_PROGRESS

    • View minor compaction information

    • View major compaction information

    Previous topic

    V$OB_SYS_TIME_MODEL
    Last

    Next topic

    V$OB_TABLET_COMPACTION_PROGRESS
    Next
    What is on this page
    Purpose
    Columns
    Sample query
    References