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

    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.3.3
    iconOceanBase Database
    SQL - V 4.3.3
    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

    Stop backup cleanup

    Last Updated:2024-12-02 03:48:29  Updated
    share
    What is on this page
    Drop a cleanup strategy
    Considerations
    Drop a cleanup strategy of a user tenant from the sys tenant
    Drop a cleanup strategy in a user tenant
    Verify whether a cleanup strategy has been dropped
    What to do next
    Cancel cleanup jobs
    Cancel the ongoing cleanup jobs of a user tenant
    Cancel ongoing cleanup jobs from the sys tenant
    Verify whether a cleanup job has been stopped

    folded

    share

    In the current version, you can stop only automatic backup cleanup jobs. To stop an automatic backup cleanup job, drop the cleanup strategy first and then stop the automatic backup cleanup job so that the job will not be scheduled again. To cancel an ongoing cleanup job, you do not need to drop the cleanup strategy.

    Drop a cleanup strategy

    Considerations

    • If you drop all cleanup strategies for a tenant, automatic cleanup is disabled for the tenant.

    • Dropping a cleanup strategy does not affect ongoing cleanup jobs. When the system schedules automatic cleanup the next time, no cleanup job will be generated for the dropped cleanup strategy.

    Drop a cleanup strategy of a user tenant from the sys tenant

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

    2. Execute the following statement to drop a cleanup strategy:

      obclient [(none)]> ALTER SYSTEM DROP DELETE BACKUP POLICY policy_name TENANT tenant_name;
      

      where

      • POLICY specifies the name of the cleanup strategy to be dropped. You can query the CDB_OB_BACKUP_DELETE_POLICY view for the strategy.

      • TENANT specifies the name of a user tenant. To drop a cleanup strategy of a user tenant from the sys tenant, you must specify the name of the user tenant.

      To drop the cleanup strategy named default for the MySQL tenant from the sys tenant, execute the following statement:

      obclient [(none)]> ALTER SYSTEM DROP DELETE BACKUP POLICY 'default' TENANT MySQL;
      

    Drop a cleanup strategy in a user tenant

    1. Log in to the database as a tenant administrator.

      Note

      The administrator user of a MySQL user tenant is root and that of an Oracle user tenant is SYS.

    2. Execute the following statement to drop a cleanup strategy:

      obclient [(none)]> ALTER SYSTEM DROP DELETE BACKUP POLICY policy_name;
      

      Here, POLICY specifies the name of the cleanup strategy to be dropped. You can query the oceanbase.DBA_OB_BACKUP_DELETE_POLICY or sys.DBA_OB_BACKUP_DELETE_POLICY view for the cleanup strategies configured for the current tenant.

      To drop the cleanup strategy named default for the current tenant, execute the following statement:

      obclient [(none)]> ALTER SYSTEM DROP DELETE BACKUP POLICY 'default';
      

    Verify whether a cleanup strategy has been dropped

    After you drop a cleanup strategy, you can query views to verify whether the cleanup strategy has been dropped.

    1. Log in to the database as an administrator of the sys tenant or a user tenant.

    2. Verify whether the cleanup strategy has been dropped.

      • In the sys tenant, query the oceanbase.CDB_OB_BACKUP_DELETE_POLICY view to verify whether the cleanup strategy of the specified tenant has been dropped.

        Here is an example:

        obclient [(none)]> SELECT * FROM oceanbase.CDB_OB_BACKUP_DELETE_POLICY  WHERE tenant_id = 1002;
        Empty set
        
      • In a user tenant, query the oceanbase.DBA_OB_BACKUP_DELETE_POLICY or sys.DBA_OB_BACKUP_DELETE_POLICY view to verify whether the cleanup strategy of the current tenant has been dropped.

        • MySQL tenant

          obclient [(none)]> SELECT * FROM oceanbase.DBA_OB_BACKUP_DELETE_POLICY;
          
        • Oracle tenant

          obclient [SYS]> SELECT * FROM sys.DBA_OB_BACKUP_DELETE_POLICY;
          

      If the cleanup strategy of the tenant does not exist in the view, the cleanup strategy has been dropped.

    What to do next

    After you drop the cleanup strategy, set a new cleanup strategy as soon as possible. Otherwise, backup files can use up the disk space, affecting subsequent backup operations. For more information about how to set a cleanup strategy, see Automatically clean up expired backup data.

    Cancel cleanup jobs

    Cancel the ongoing cleanup jobs of a user tenant

    1. Log in to the database as a tenant administrator.

    2. Execute the following statement to stop the ongoing cleanup jobs of the current tenant:

      obclient [(none)]>  ALTER SYSTEM CANCEL DELETE BACKUP;
      

    Cancel ongoing cleanup jobs from the sys tenant

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

    2. Execute the following statement to stop the ongoing cleanup jobs of a specified tenant:

      obclient [(none)]> ALTER SYSTEM CANCEL DELETE BACKUP TENANT tenant_name_list;
      

      Here, TENANT specifies the name of the user tenant whose cleanup jobs are to be canceled. You can specify multiple user tenant names. The ongoing cleanup jobs of the specified user tenant will be canceled.

      To cancel the ongoing cleanup jobs of the MySQL and Oracle tenants from the sys tenant, execute the following statement:

      obclient [(none)]> ALTER SYSTEM CANCEL DELETE BACKUP TENANT MySQL, Oracle;
      

      If you do not specify TENANT, the ongoing cleanup jobs of all user tenants are canceled.

      obclient [(none)]> ALTER SYSTEM CANCEL DELETE BACKUP;
      

    Verify whether a cleanup job has been stopped

    After you stop a cleanup job, you can query views to verify whether the cleanup job has been stopped.

    1. Log in to the database as an administrator of the sys tenant or a user tenant.

    2. Verify whether the cleanup job has been stopped.

      1. Query whether the cleanup job is ongoing.

        You can query the oceanbase.CDB_OB_BACKUP_DELETE_JOBS view from the sys tenant to view the execution status of the cleanup jobs of all tenants. You can query the oceanbase.DBA_OB_BACKUP_DELETE_JOBS or sys.DBA_OB_BACKUP_DELETE_JOBS view in the current user tenant to check the execution status of its cleanup jobs.

        To query the execution status of the cleanup jobs of a specified user tenant from the sys tenant, execute the following statement:

        obclient [(none)]> SELECT * FROM oceanbase.CDB_OB_BACKUP_DELETE_JOBS WHERE tenant_id = 1002\G
        *************************** 1. row ***************************
                        TENANT_ID: 1002
                           JOB_ID: 1
                      INCARNATION: 1
              INITIATOR_TENANT_ID: 1002
                 INITIATOR_JOB_ID: 7
               EXECUTOR_TENANT_ID: 1002
                             TYPE: DELETE OBSOLETE BACKUP
                        PARAMETER: 2022-05-31 12:09:40.060284
                        JOB_LEVEL: USER_TENANT
                  START_TIMESTAMP: 2022-06-01 12:09:53.389512
                    END_TIMESTAMP:
                           STATUS: CANCELING
                       TASK_COUNT: 2
               SUCCESS_TASK_COUNT: 1
                           RESULT: 0
                          COMMENT:  
        1 row in set
        

        If the value of STATUS is INIT, DOING, or CANCELING, the corresponding cleanup job is still ongoing.

        If you cannot query the ongoing cleanup jobs of a user tenant in the preceding views, you can query the history of cleanup jobs to verify the execution result of a cleanup job.

        obclient [(none)]> SELECT * FROM oceanbase.CDB_OB_BACKUP_DELETE_JOBS where tenant_id = 1002;
        Empty set
        
      2. Query historical cleanup jobs.

        You can query the oceanbase.CDB_OB_BACKUP_DELETE_JOB_HISTORY view from the sys tenant for the historical cleanup jobs of all tenants. You can query the oceanbase.DBA_OB_BACKUP_DELETE_JOB_HISTORY view from a MySQL tenant or the sys.DBA_OB_BACKUP_DELETE_JOB_HISTORY view from an Oracle tenant for the historical cleanup jobs of the current tenant.

        To query the historical cleanup jobs of a specified user tenant from the sys tenant, execute the following statement:

        obclient [(none)]> SELECT * FROM oceanbase.CDB_OB_BACKUP_DELETE_JOB_HISTORY where tenant_id = 1002\G
        *************************** 1. row ***************************
                       TENANT_ID: 1002
                          JOB_ID: 1
                     INCARNATION: 1
             INITIATOR_TENANT_ID: 1002
                INITIATOR_JOB_ID: 7
              EXECUTOR_TENANT_ID: 1002
                            TYPE: DELETE OBSOLETE BACKUP
                       PARAMETER: 2022-05-31 12:09:40.060284
                       JOB_LEVEL: USER_TENANT
                 START_TIMESTAMP: 2022-06-01 12:09:53.389512
                   END_TIMESTAMP: 2022-06-01 12:10:36.829576
                          STATUS: CANCELED
                      TASK_COUNT: 2
              SUCCESS_TASK_COUNT: 2
                          RESULT: 0
                         COMMENT:
        1 row in set
        

        If the value of STATUS is COMPLETED, FAILED, or CANCELED, the corresponding cleanup job has been stopped.

    Previous topic

    Automatic cleanup of expired backups
    Last

    Next topic

    Query the backup cleanup progress
    Next
    What is on this page
    Drop a cleanup strategy
    Considerations
    Drop a cleanup strategy of a user tenant from the sys tenant
    Drop a cleanup strategy in a user tenant
    Verify whether a cleanup strategy has been dropped
    What to do next
    Cancel cleanup jobs
    Cancel the ongoing cleanup jobs of a user tenant
    Cancel ongoing cleanup jobs from the sys tenant
    Verify whether a cleanup job has been stopped