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 - V3.2.4Enterprise Edition

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogWhite PaperLive 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. V3.2.4
    iconOceanBase Database
    SQL - V 3.2.4Enterprise Edition
    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

    Initiate a log backup

    Last Updated:2023-10-27 09:57:43  Updated
    Share
    What is on this page
    Prerequisites
    Procedure

    folded

    Share

    This topic describes how to initiate a log backup after you prepare for backup.

    Prerequisites

    Preparations for backup are completed.

    Procedure

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

    2. (Optional) Configure the backup mode and enable compression of archived logs.

      • The backup mode can be configured as Optional or Mandatory. The default backup mode is Optional.

        • The optional mode prioritizes user business. In this mode, logs may be recycled before they are archived, interrupting the backup.

        • The mandatory mode prioritizes backup. In this mode, you may be unable to write more data before existing data is backed up.

      • You can use the zstd_1.3.8 and lz4_1.0 algorithms to compress archived logs. The default compression algorithm is lz4_1.0.

      The following example selects the optional mode and enables the compression of archived logs:

      obclient> ALTER SYSTEM SET backup_log_archive_option = 'optional compression= enable';
      

      You can dynamically switch the compression algorithm as needed by executing the following statement:

      obclient> ALTER SYSTEM SET backup_log_archive_option='optional compression= zstd_1.3.8';
      
      obclient> ALTER SYSTEM SET backup_log_archive_option='optional compression= lz4_1.0';
      

      Note

      To disable the compression of archived logs, execute the following statement:

      • In optional mode, you can either execute the ALTER SYSTEM SET backup_log_archive_option = 'compression= disable'; statement to disable compression, or execute the ALTER SYSTEM SET backup_log_archive_option = 'mandatory compression= disable'; statement to configure the backup mode and disable log compression.
      • In mandatory mode, you can only execute the ALTER SYSTEM SET backup_log_archive_option = 'optional compression= disable'; statement to configure the backup mode and disable log compression.

    3. Execute the following statement to enable log backup:

      Note

      To save some time, we recommend that you initiate a minor compaction before enabling log backup. This is because log backup starts from the last minor compaction. For more information about how to initiate a minor compaction, see Manually initiate a minor compaction.

      obclient> ALTER SYSTEM ARCHIVELOG;
      

      After log backup is enabled, OceanBase Database regularly backs up the transaction logs generated by the clusters to the specified destination.

    4. Execute the following statement to check whether the log backup task is started:

      obclient> SELECT * FROM CDB_OB_BACKUP_ARCHIVELOG;
      

      When STATUS is DOING, the log backup task is started.

      For more information about fields in CDB_OB_BACKUP_ARCHIVELOG, see CDB_OB_BACKUP_ARCHIVELOG.

    5. Execute the following statement to view the status of backup pieces in the backup set:

      obclient> SELECT * FROM CDB_OB_BACKUP_PIECE_FILES;
      

      For more information about fields in CDB_OB_BACKUP_PIECE_FILES, see CDB_OB_BACKUP_PIECE_FILES.

    Previous topic

    Preparations for backup
    Last

    Next topic

    Initiate a data backup
    Next
    What is on this page
    Prerequisites
    Procedure