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

    BALANCE JOB

    Last Updated:2026-04-15 08:24:15  Updated
    share
    What is on this page
    Purpose
    Limitations and considerations
    Privilege requirements
    Syntax
    Parameters
    Examples
    References

    folded

    share

    Purpose

    This statement is used to suspend (SUSPEND), resume (RESUME), or cancel (CANCEL) a balance job.

    When a tenant has an ongoing balance job and there are other urgent changes to be executed, to prevent the execution of the balance job from affecting the urgent changes, the user can choose to suspend the current balance job and resume it after the urgent changes are completed.

    If the current balance job does not meet your requirements, you can cancel it. Additionally, if you have started a transfer partition task but it has been delayed due to an ongoing balance job, you can also cancel the current balance job.

    Limitations and considerations

    • For V4.2.5, the ability to suspend and resume balance jobs was introduced starting from V4.2.5 BP2.

    • The operations to cancel, suspend, or resume a balance job can only be performed on the primary database (i.e., the primary tenant).

    • When suspending or resuming a balance job, the job's status must not be CANCELING.

    Privilege requirements

    The current user must have the ALTER SYSTEM privilege.

    Syntax

    ALTER SYSTEM {SUSPEND | RESUME | CANCEL} BALANCE JOB [TENANT = 'tenant_name'];
    

    Parameters

    Parameter Description
    tenant_name The name of the tenant for which you want to cancel the task. This parameter is optional but required when executed under the system tenant.

    Examples

    The following example demonstrates the operation under the system tenant.

    1. Query the current tasks and their statuses.

      obclient> SELECT T.TENANT_NAME, J.TENANT_ID, J.JOB_ID, J.CREATE_TIME, J.MODIFY_TIME, J.BALANCE_STRATEGY, J.JOB_TYPE, j.STATUS
      FROM oceanbase.CDB_OB_BALANCE_JOBS J, oceanbase.DBA_OB_TENANTS T
      WHERE J.TENANT_ID = T.TENANT_ID;
      

      The result is as follows:

      +-------------+-----------+--------+----------------------------+----------------------------+---------------------------+--------------+--------+
      | TENANT_NAME | TENANT_ID | JOB_ID | CREATE_TIME                | MODIFY_TIME                | BALANCE_STRATEGY          | JOB_TYPE     | STATUS |
      +-------------+-----------+--------+----------------------------+----------------------------+---------------------------+--------------+--------+
      | oracle001   |      1004 | 300793 | 2024-02-29 16:45:12.864110 | 2024-02-29 16:45:12.864110 | LS balance by shrink      | LS_BALANCE   | DOING  |
      +-------------+-----------+--------+----------------------------+----------------------------+---------------------------+--------------+--------+
      1 row in set
      
    2. Based on your business needs, choose the appropriate action:

      • Suspend the ongoing balance job

        obclient> ALTER SYSTEM SUSPEND BALANCE JOB TENANT = 'oracle001';
        
      • Resume the suspended balance job

        obclient> ALTER SYSTEM RESUME BALANCE JOB TENANT = 'oracle001';
        
      • Cancel the balance job that does not meet your requirements

        obclient> ALTER SYSTEM CANCEL BALANCE JOB TENANT = 'oracle001';
        

    References

    • oceanbase.CDB_OB_BALANCE_JOBS

    • oceanbase.DBA_OB_TENANTS

    • Cancel a balance job

    Previous topic

    CANCEL BACKUP
    Last

    Next topic

    CANCEL DELETE BACKUP
    Next
    What is on this page
    Purpose
    Limitations and considerations
    Privilege requirements
    Syntax
    Parameters
    Examples
    References