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

Perform tenant O&M operations

Last Updated:2025-11-28 06:07:04  Updated
share
What is on this page
Examples
Create a standby tenant
View the tenant status
Perform O&M operations on the tenant
Query the information about the tenant O&M operations

folded

share

A tenant contains various resources. To prevent a tenant from becoming bloated and improve tenant O&M flexibility, ob-operator provides the tenant O&M resource OBTenantOperation for you to perform intra-tenant and inter-tenant O&M operations. ob-operator V2.1.0 supports three O&M operations: changing the password of the root user, activating a standby tenant, and executing a primary/standby tenant switchover. Standby tenant activation and primary/standby tenant switchover are related to the physical standby database feature. Here are sample configurations of the three O&M operations:

# Change the password.
apiVersion: oceanbase.oceanbase.com/v1alpha1
kind: OBTenantOperation
metadata:
  name: op-chg-pwd
  namespace: oceanbase
spec:
  type: "CHANGE_PASSWORD"
  changePwd:
    tenant: "t1"
    secretRef: "t1-credential-new"
# Upgrade a standby tenant to the primary tenant.
apiVersion: oceanbase.oceanbase.com/v1alpha1
kind: OBTenantOperation
metadata:
  name: op-failover
  namespace: oceanbase
spec:
  type: "FAILOVER"
  failover:
    standbyTenant: "t1s"
# Perform a primary/standby tenant switchover.
apiVersion: oceanbase.oceanbase.com/v1alpha1
kind: OBTenantOperation
metadata:
  name: op-switchover
  namespace: oceanbase
spec:
  type: "SWITCHOVER"
  switchover:
    primaryTenant: "t1"
    standbyTenant: "t1s"

Examples

Create a standby tenant

kubectl apply -f tenant_restore.yaml

View the tenant status

kubectl get obtenants.oceanbase.oceanbase.com -n oceanbase

The command output is as follows:

NAME   STATUS    TENANTNAME   TENANTROLE   CLUSTERNAME   AGE
t1     running   t1           PRIMARY      obcluster     3d4h
t1s    running   t1s          STANDBY      obcluster     3h30m

Perform O&M operations on the tenant

kubectl apply -f tenant_op_change_pwd.yaml
kubectl apply -f tenant_op_failover.yaml

Query the information about the tenant O&M operations

kubectl get obtenantoperations.oceanbase.oceanbase.com -n oceanbase

The command output is as follows:

NAME          TYPE       STATUS       AGE   CLUSTER     PRIMARYTENANT
op-failover   FAILOVER   SUCCESSFUL   8s    obcluster   t1s

Note that the value of the PRIMARYTENANT field in the output indicates the new primary tenant after the switchover. The value of the SECONDARYTENANT field in the output indicates the new standby tenant after the switchover. To save space, the SECONDARYTENANT field is not exported by default. You can run the kubectl get obtenantoperations.oceanbase.oceanbase.com -o wide command to view it.

Previous topic

Delete a tenant
Last

Next topic

High availability
Next
What is on this page
Examples
Create a standby tenant
View the tenant status
Perform O&M operations on the tenant
Query the information about the tenant O&M operations