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

Kubernetes operator for OceanBase

V2.3.1Community Edition

  • Overview
  • Quick start
  • Deploy
  • Upgrade
  • User guide
    • Cluster management
      • Manage clusters
      • Create a cluster
      • Zone management
        • Add zones to a cluster
        • Delete zones from a cluster
      • Server management
        • Add OBServer nodes to zones
        • Delete OBServer nodes from zones
      • Upgrade a cluster
      • Manage parameters
      • Update resources
      • Delete a cluster
    • Tenant management
      • Manage tenants
      • Create a tenant
      • Modify tenant
        • Manage resources
        • Manage replicas
        • Modify other parameters
      • Delete a tenant
      • Perform tenant O&M operations
    • High availability
      • High availability
      • Recover from node failure
      • Back up a tenant
      • Restore data from a backup
      • Physical standby tenant
      • Inter K8s cluster management
  • Configure
  • Appendix
    • Deploy OceanBase Database and web app in a Kubernetes cluster
    • FAQ
  • Changelog

Download PDF

Overview Quick start Deploy Upgrade Manage clusters Create a cluster Upgrade a cluster Manage parameters Update resources Delete a cluster Manage tenants Create a tenant Delete a tenant Perform tenant O&M operations High availability Recover from node failure Back up a tenant Restore data from a backup Physical standby tenant Inter K8s cluster management Configure Deploy OceanBase Database and web app in a Kubernetes cluster FAQ Changelog
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. Kubernetes operator for OceanBase
  3. V2.3.1
iconKubernetes operator for OceanBase
V 2.3.1Community Edition
Community Edition
  • V 2.3.1
  • V 2.3.0
  • V 2.2.0
  • V 2.1.2
  • V 2.1.1
  • V 2.1.0

Back up a tenant

Last Updated:2025-11-28 06:07:04  Updated
share
What is on this page
Prerequisites
Configure backup policies
Sample configurations
Configuration description
Common operations
Initiate a backup job
View the status of the backup policy
View the status of the backup job
View details of the backup policy

folded

share

This topic describes how to back up the data of a tenant. OBTenantBackupPolicy and OBTenantBackup resources are key to tenant data backup. You can use OBTenantBackupPolicy to define backup policies and OBTenantBackup to define backup jobs. A backup policy specifies the interval of log archiving and data backup parameters for a tenant in an OceanBase cluster. When a backup policy takes effect, a backup job is created to execute specific operations. The backup destination can be a Network File System (NFS) volume or an Alibaba Cloud Object Storage Service (OSS) bucket.

Prerequisites

To back up data to an NFS volume, make sure that backup volume has been configured when the OceanBase cluster is deployed and can be accessed, and that you have the read and write permissions on the NFS volume.

Configure backup policies

Sample configurations

You can use the configuration file to specify a backup policy for a specific tenant. Here is an example:

apiVersion: oceanbase.oceanbase.com/v1alpha1
kind: OBTenantBackupPolicy
metadata:
  name: backup-policy-example
  namespace: oceanbase
spec:
  obClusterName: "test"
  tenantName: "t1"
  tenantSecret: "t1-credential"
  tenantCRName: "tenant-cr"
  jobKeepWindow: "1d"
  suspend: false
  dataClean:
    recoveryWindow: "8d"
  logArchive:
    destination:
      type: "OSS"
      path: "oss://bucket/archive?host=oss-cn-hangzhou.aliyuncs.com"
      ossAccessSecret: "oss-access"
      # type: "NFS"
      # path: "t1/logArchive"
    switchPieceInterval: "1d"
    binding: Optional
  dataBackup:
    destination:
      type: "OSS"
      path: "oss://bucket/backup?host=oss-cn-hangzhou.aliyuncs.com"
      ossAccessSecret: "oss-access"
      # type: "NFS"
      # path: "t1/dataBackup"
    fullCrontab: "30 0 * * 6"
    incrementalCrontab: "30 1 * * *"
    encryptionSecret: t1-encryption

Configuration description

The parameters are described as follows:

  • obClusterName: the name of the OceanBase cluster in the same namespace.
  • tenantName: the tenant name in the OceanBase cluster.
  • tenantSecret: the name of the secret resource that contains the password of the root user of the specified tenant, whose name is the value of the tenantName parameter.
  • tenantCRName: the name of the custom resources of the OceanBase Database tenant. If you specify this parameter, you do not need to specify the tenantName or tenantSecret parameter.
  • jobKeepWindow: the time window for which the resources for a backup job are retained.
  • suspend: specifies whether the backup job can be suspended. The default value is false.
  • dataClean: the configuration for the cleanup of expired backup data.
    • recoveryWindow: the time window for data recovery.
  • logArchive: the configuration for log archiving.
    • destination: the destination of the backup data.
    • switchPieceInterval: the switching interval of pieces of archived logs. The value range is [1d,7d]. The default value is 1d.
    • binding: the mode for prioritizing archiving and business. Optional and Mandatory modes are supported. By default, Optional mode is used.
  • dataBackup: the configuration for data backup.
    • destination: the destination of the backup data.
    • fullCrontab: the scheduled timestamp, in the cron expression format, when a full data backup job is triggered. For more information, visit https://crontab.guru/.
    • incrementalCrontab: the scheduled timestamp, in the cron expression format, when an incremental data backup job is triggered. For more information, visit https://crontab.guru/.
    • encryptionSecret: the name of the secret resource for data backup encryption.

The parameters are described as follows:

destination:

  • type: the type of the destination. Valid values are NFS and OSS.
  • path: the path of the backup destination. If you use an OSS backup destination, the path must start with oss://. If you use an NFS backup destination, you must specify a relative path, which must not start with /.
  • ossAccessSecret: the name of the secret resource that stores the OSS access credential. If you use an OSS backup destination, you must specify this parameter.

Here is the configuration of a sample tenantSecret resource:

apiVersion: v1
kind: Secret
metadata:
  name: tenant-root
  namespace: oceanbase
data:
  # base64 encoded
  password: ******

Here is the configuration of a sample encryptionSecret resource:

apiVersion: v1
kind: Secret
metadata:
  name: tenant-backup-encryption
  namespace: oceanbase
data:
  # base64 encoded
  password: ******

Here is the configuration of a sample ossAccessSecret resource:

apiVersion: v1
kind: Secret
metadata:
  name: oss-access
  namespace: obcluster
data:
  # base64 encoded
  accessId: ******
  accessKey: ******

Common operations

Initiate a backup job

Specify the name of the related secret resource as needed and run the following command to create the secret resource:

kubectl apply -f tenant-secret.yaml
kubectl apply -f backup-encryption.yaml
kubectl apply -f oss-access.yaml

Run the following command to create a tenant backup policy:

kubectl apply -f backup-policy.yaml

View the status of the backup policy

Run the following command to view the status of the backup policy:

kubectl get obtenantbackuppolicies.oceanbase.oceanbase.com -n oceanbase

The command output is as follows:

NAME                       STATUS    AGE     TENANTNAME   NEXTFULL              NEXTINCREMENTAL   FULLCRONTAB    INCREMENTALCRONTAB
backup-policy-example      RUNNING   2m46s   t1           2023-11-10 11:07:58                     */60 * * * *   */25 * * * *

View the status of the backup job

When a backup policy takes effect, a backup job is created to execute specific operations. You can run the following command to view the status of a backup job:

kubectl get obtenantbackups.oceanbase.oceanbase.com -n oceanbase

The command output is as follows:

NAME                                              TYPE      STATUS       TENANTNAME   STARTEDAT                    ENDEDAT
backup-policy-example-clean-20231110110746        CLEAN     RUNNING      t1                                        
backup-policy-example-full-20231110110756         FULL      SUCCESSFUL   t1           2023-11-10 11:08:06.952711   2023-11-10 11:13:31.079246
backup-policy-example-archive-20231110110746      ARCHIVE   RUNNING      t1           2023-11-10 11:07:50.139978   2023-11-10 11:13:50.128627

View details of the backup policy

You can view details of the backup policy by running the following two commands.

  • Run the kubectl get -o yaml command:
kubectl get -n oceanbase obtenantbackuppolicies.oceanbase.oceanbase.com backup-policy-example -o yaml

The command output is as follows:

apiVersion: oceanbase.oceanbase.com/v1alpha1
kind: OBTenantBackupPolicy
metadata:
  creationTimestamp: "2023-11-10T03:07:39Z"
  finalizers:
  - obtenantbackuppolicy.finalizers.oceanbase.com
  generation: 1
  name: backup-policy-example
  namespace: oceanbase
  resourceVersion: "775461"
  uid: 7ab40200-f849-434d-b1a5-6aad888cf42e
spec:
  dataBackup:
    destination:
      ossAccessSecret: oss-access
      path: oss://bucket/backup?host=oss-cn-hangzhou.aliyuncs.com
      type: OSS
    fullCrontab: '*/60 * * * *'
    incrementalCrontab: '*/25 * * * *'
    encryptionSecret: t1-encryption
  dataClean:
    recoveryWindow: 8d
  jobKeepWindow: 1d
  logArchive:
    destination:
      ossAccessSecret: oss-access
      path: oss://bucket/archive?host=oss-cn-hangzhou.aliyuncs.com
      type: OSS
    switchPieceInterval: 1d
  obClusterName: test
  tenantName: t1
  tenantSecret: t1-credential
status:
  latestArchiveLogJob:
    fields: values...
  latestFullBackupJob:
    fields: values...
  nextFull: "2023-11-10 12:00:00"
  nextIncremental: "2023-11-10 11:25:00"
  observedGeneration: 1
  status: RUNNING
  tenantCR:
    fields: values...
  tenantInfo:
    fields: values...
  • Run the kubectl describe command:
kubectl describe -n oceanbase obtenantbackuppolicies.oceanbase.oceanbase.com backup-policy-example

The command output is as follows:

Name:         backup-policy-example
Namespace:    oceanbase
Labels:       <none>
Annotations:  <none>
API Version:  oceanbase.oceanbase.com/v1alpha1
Kind:         OBTenantBackupPolicy
Metadata:
  Creation Timestamp:  2023-11-10T03:07:39Z
  Finalizers:
    obtenantbackuppolicy.finalizers.oceanbase.com
  Generation:        1
  Resource Version:  775477
  UID:               7ab40200-f849-434d-b1a5-6aad888cf42e
Spec:
  Data Backup:
    Destination:
      Oss Access Secret:  oss-access
      Path:               oss://bucket/backup?host=oss-cn-hangzhou.aliyuncs.com
      Type:               OSS
    Full Crontab:         */60 * * * *
    Incremental Crontab:  */25 * * * *
    Encryption Secret:    t1-encryption
  Data Clean:
    Recovery Window:  8d
  Job Keep Window:    1d
  Log Archive:
    Destination:
      Oss Access Secret:    oss-access
      Path:                 oss://bucket/archive?host=oss-cn-hangzhou.aliyuncs.com
      Type:                 OSS
    Switch Piece Interval:  1d
  Ob Cluster Name:          test
  Tenant Name:              t1
  Tenant Secret:            t1-credential
Status:
  Latest Archive Log Job:
    fields: values...
  Latest Full Backup Job:
    fields: values...
  Next Full:             2023-11-10 12:00:00
  Next Incremental:      2023-11-10 11:25:00
  Observed Generation:   1
  Status:                RUNNING
  Tenant CR:
    fields: values...
  Tenant Info:
    fields: values...
Events:
  Type    Reason  Age   From                             Message
  ----    ------  ----  ----                             -------
  Normal          12m   obtenantbackuppolicy-controller  init status

Previous topic

Recover from node failure
Last

Next topic

Restore data from a backup
Next
What is on this page
Prerequisites
Configure backup policies
Sample configurations
Configuration description
Common operations
Initiate a backup job
View the status of the backup policy
View the status of the backup job
View details of the backup policy