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

    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.1
    iconOceanBase Database
    SQL - V 4.2.1
    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

    Back up a cluster

    Last Updated:2026-04-28 09:23:26  Updated
    share
    What is on this page
    Prerequisites
    Configure a backup task
    Initiate a backup
    View the backup status

    folded

    share

    This topic describes how to back up data in a cluster by taking OceanBase Database V3.x as an example.

    Prerequisites

    • To back up data to a network file system (NFS), ensure that backup volumes have been configured when the OceanBase cluster is deployed, the NFS can be accessed, and you have the read and write permissions on the NFS.

    • At least one major compaction has been completed for the cluster to be backed up.

    Configure a backup task

    The content of the configuration file for cluster backup is as follows:

    apiVersion: cloud.oceanbase.com/v1
    kind: Backup
    metadata:
      name: ob-backup
      namespace: obcluster
    spec:
      destPath: file:///ob-backup
      source:
        clusterName: ob-test
        clusterID: 1
        clusterNamespace: obcluster
      schedule:
      - name: f # f/i
        schedule: '*/10 * * * *'
      - name: i
        schedule: '*/5 * * * *'
      secret: backup-secret
    

    The parameters are described as follows:

    • destPath: the storage path of the backup data. NFS and OSS are supported. A NFS path is in the format of file:///backuppath. An OSS path is in the format of oss://oceanbase-test-bucket/backup/?host=xxx.aliyuninc.com&access_id=xxx&access_key=xxx&delete_mode=delete'.

    • source: the information about the source cluster, including the cluster name, cluster ID, and namespace where the cluster resides.

    • schedule: the scheduling strategies. You can set strategies respectively named f and i, which respectively indicate full data backup and incremental data backup. The backup cycle is specified by using a cron expression.

    • secret: the secret configured for backup data encryption.

    Here is a configuration example of secret:

    apiVersion: v1
    kind: Secret
    metadata:
      name: backup-secret
      namespace: obcluster
    data:
      # base64 encoded data
      incremental: ******
      full: ******
    

    The key parameters are described as follows:

    • incremental: the encryption password for incremental backup.

    • full: the encryption password for full backup.

    Initiate a backup

    Run the following command to create a backup related secret:

    kubectl apply -f secret.yaml
    

    Run the following command to create a custom resource for data backup:

    kubectl apply -f backup.yaml
    

    View the backup status

    • Run the following command to view the cluster backup status:

      kubectl get backups -A
      

      The returned result is as follows:

      NAMESPACE   NAME        AGE
      obcluster   ob-backup   16h
      
    • Run the following command to view the backup details:

      kubectl get backup ob-backup -n obcluster -o yaml
      

      The returned result is as follows:

      apiVersion: cloud.oceanbase.com/v1
      kind: Backup
      metadata:
        annotations:
          kubectl.kubernetes.io/last-applied-configuration: |
            {"apiVersion":"cloud.oceanbase.com/v1","kind":"Backup","metadata":{"annotations":{},"name":"ob-backup","namespace":"obcluster"},"spec":{"destPath":"file:///ob-backup","schedule":[{"name":"f","schedule":"*/10 * * * *"},{"name":"i","schedule":"*/5 * * * *"}],"secret":"backup-secret","source":{"clusterID":1,"clusterName":"ob-314","clusterNamespace":"obcluster"}}}
        creationTimestamp: "2023-07-24T13:18:18Z"
        finalizers:
        - cloud.oceanbase.com.finalizers.ob-backup
        generation: 1
        name: ob-backup
        namespace: obcluster
        resourceVersion: "380797"
        uid: b926732e-510c-4e14-8657-972bff04bb1d
      spec:
        destPath: file:///ob-backup
        schedule:
        - name: f
          schedule: '*/10 * * * *'
        - name: i
          schedule: '*/5 * * * *'
        secret: backup-secret
        source:
          clusterID: 1
          clusterName: ob-314
          clusterNamespace: obcluster
      status:
        backup set:
        - backupType: D
          bsKey: 196
          clusterName: ob-314
          status: SUCCESS
          tenantID: 1
          tenantName: sys
        - backupType: I
          bsKey: 195
          clusterName: ob-314
          status: SUCCESS
          tenantID: 1
          tenantName: sys
        - backupType: D
          bsKey: 196
          clusterName: ob-314
          status: SUCCESS
          tenantID: 1001
          tenantName: tenant3
        - backupType: I
          bsKey: 195
          clusterName: ob-314
          status: SUCCESS
          tenantID: 1001
          tenantName: tenant3
        schedule:
        - name: FULL
          nextTime: 2023-07-25 14:00:00 +0800 CST
          schedule: '*/10 * * * *'
        - name: INCREMENTAL
          nextTime: 2023-07-25 13:55:00 +0800 CST
          schedule: '*/5 * * * *'
      

    Previous topic

    Delete a tenant
    Last

    Next topic

    Back up a tenant
    Next
    What is on this page
    Prerequisites
    Configure a backup task
    Initiate a backup
    View the backup status