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.2.5

    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.2.5
    iconOceanBase Database
    SQL - V 4.2.5
    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

    Manually initiate a minor compaction

    Last Updated:2026-04-09 09:38:52  Updated
    share
    What is on this page
    Procedure
    Initiate a minor compaction from a user tenant
    What to do next
    References

    folded

    share

    You can execute the ALTER SYSTEM MINOR FREEZE statement in the sys tenant to manually initiate a minor compaction at the tenant, zone, server, log stream, or partition level.

    Procedure

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

    2. Select a proper minor compaction type as needed.

      • Minor compaction at the tenant level

        You can initiate a minor compaction for one or more tenants by executing the following SQL statement:

        obclient> ALTER SYSTEM MINOR FREEZE TENANT [=] all_user | all | all_meta | tenant_name [, tenant_name ...];
        

        Here are some examples:

        • Initiate a minor compaction for the current tenant from the sys tenant

          obclient> ALTER SYSTEM MINOR FREEZE;
          
        • Initiate a minor compaction for all user tenants from the sys tenant

          obclient> ALTER SYSTEM MINOR FREEZE TENANT = all_user;
          

          or

          obclient> ALTER SYSTEM MINOR FREEZE TENANT = all;
          

          Note

          In OceanBase Database V4.2.1 and later, TENANT = all_user and TENANT = all express the same semantics. If you want an operation to take effect on all user tenants, we recommend that you use TENANT = all_user. TENANT = all will be deprecated.

        • Initiate a minor compaction for all meta tenants from the sys tenant

          obclient> ALTER SYSTEM MINOR FREEZE TENANT = all_meta;
          
        • Initiate a minor compaction for a specified tenant from the sys tenant

          obclient> ALTER SYSTEM MINOR FREEZE TENANT = tenant1;
          
      • Minor compaction at the zone level

        You can initiate a minor compaction for a specified zone by using the following SQL statement:

        obclient> ALTER SYSTEM MINOR FREEZE ZONE [=] zone_name;
        

        Here is an example:

        obclient> ALTER SYSTEM MINOR FREEZE ZONE = zone1;
        
      • Minor compaction at the server level

        You can initiate a minor compaction for one or more specified OBServer nodes by using the following SQL statement:

        obclient> ALTER SYSTEM MINOR FREEZE SERVER = ('ip:port' [, 'ip:port'...]);
        

        Here is an example:

        obclient> ALTER SYSTEM MINOR FREEZE SERVER = ('xx.xx.xx.xx:2882','xx.xx.xx.xx:2882');
        
      • Minor compaction at the log stream level

        You can initiate a minor compaction for a specified log stream of a specified tenant by using the following SQL statement:

        ALTER SYSTEM MINOR FREEZE TENANT [=] tenant_name LS [=] ls_id;
        

        In the statement, tenant_name specifies the name of a tenant and ls_id specifies the ID of a log stream in the tenant. You can query the oceanbase.CDB_OB_TABLE_LOCATIONS view for IDs of log streams.

        Here is an example:

        obclient> ALTER SYSTEM MINOR FREEZE TENANT = t1 LS = 1001;
        

        After you execute this statement, the system performs a minor compaction for all tablets in the specified log stream of the specified tenant.

      • Minor compaction at the partition level

        In OceanBase Database, one partition corresponds to one tablet.

        You can initiate a minor compaction for a specified tablet in a specified tenant by using the following SQL statement:

        ALTER SYSTEM MINOR FREEZE TENANT [=] tenant_name TABLET_ID = tablet_id;
        

        You can also initiate a minor compaction for a specified tablet in a specified log stream of a specified tenant by using the following SQL statement:

        ALTER SYSTEM MINOR FREEZE TENANT [=] tenant_name LS [=] ls_id TABLET_ID = tablet_id;
        

        Here, tenant_name specifies the name of a tenant, ls_id specifies the ID of a log stream in the tenant, and tablet_id specifies the ID of a tablet in the log stream. You can query the oceanbase.CDB_OB_TABLE_LOCATIONS view for log stream IDs and tablet IDs.

        The following example shows how to initiate a minor compaction for a specified tablet in a specified tenant:

        obclient> ALTER SYSTEM MINOR FREEZE TENANT = t1 TABLET_ID  = 200001;
        

        The following example shows how to initiate a minor compaction for a specified tablet in a specified log stream of a specified tenant:

        obclient> ALTER SYSTEM MINOR FREEZE TENANT = t1 LS = 1001 TABLET_ID = 200001;
        

    Initiate a minor compaction from a user tenant

    If you are logged in to a user tenant, you can initiate only tenant-level minor compactions for the current tenant.

    1. Log in to a MySQL or Oracle tenant of the cluster as the administrator of the tenant.

    2. Initiate a minor compaction for the current tenant based on your business needs.

      obclient> ALTER SYSTEM MINOR FREEZE;
      

    What to do next

    After you initiate a minor compaction, you can view the information about it. For more information, see View minor compaction information.

    References

    • Automatically trigger a minor compaction

    • Modify minor compaction settings

    Previous topic

    Automatically trigger a minor compaction
    Last

    Next topic

    View minor compaction information
    Next
    What is on this page
    Procedure
    Initiate a minor compaction from a user tenant
    What to do next
    References