Meet OceanBase AI Database, the unified database for operational data, real-time analytics, and AI. Explore ->

Meet OceanBase AI Database, the unified database for operational data, real-time analytics, and AI. Explore ->

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 Deployer

V4.3.0Community Edition

  • What is obd
  • Quick Start
    • Install obd
    • Quick deployment of OceanBase Database
    • Quickly deploy OCP
  • obd Command
    • Quick deployment commands
    • Cluster commands
    • Command groups
    • Image and repository commands
    • Test command groups
    • Tool commands
    • obdiag commands
    • Binlog service commands
    • Hardware commands
    • License commands
    • Password commands
    • Telemetry commands
  • User Guide
    • Usage overview
    • Deploy through GUI
      • Overview
      • Pattern configuration rules
      • Deploy an OceanBase cluster
      • Deploy OCP
      • Deploy OMS
      • Change components
      • Upgrade OCP
      • Upgrade OMS
    • Deploy through CLI
      • Configuration file
      • Component deployment
        • Deploy an OceanBase cluster
        • Deploy seekdb
        • Deploy obconfigserver
        • Deploy OMS
        • Deploy OCP
        • Deploy Alertmanager
        • Deploy obbinlog
        • Deploy oblogproxy
      • Cluster management
        • Physical Standby Database
          • Create a standby tenant
          • Role switching and decoupling
          • Switch the synchronization mode between primary and standby tenants
        • seekdb primary/standby instance
          • Create a standby instance
          • Role switching and decoupling
        • Scale out and component changes
        • Performance test
        • Diagnose a cluster
        • Backup and restore
        • Add a GUI monitoring system to an existing cluster
      • Cluster management
        • Use OCP to take over an OceanBase cluster deployed by obd
        • Take over an OceanBase cluster
      • Component upgrade
        • Upgrade OceanBase Database
        • Upgrade ODP
        • Upgrade OMS
  • Upgrade obd
  • FAQ
  • Error codes
  • Release Notes
    • Version rules
    • V4.3
      • OceanBase Deploy V4.3.0
    • V4.2
      • OceanBase Deployment Tool V4.2.0
    • V4.1
      • OceanBase Deployer V4.1.0
    • V4.0
      • OceanBase Deployer V4.0.0
    • V3.6
      • OceanBase Deployer V3.6.0
    • V3.5
      • OceanBase Deployer V3.5.0
    • V3.4
      • OceanBase Deployer V3.4.0
    • V3.3
      • OceanBase Deployer V3.3.0
    • V3.2
      • OceanBase Deployer V3.2.2
      • OceanBase Deployer V3.2.1
      • OceanBase Deployer V3.2.0
    • V3.1
      • OceanBase Deployer V3.1.2
      • OceanBase Deployer V3.1.1
      • OceanBase Deployer V3.1.0
    • V3.0
      • OceanBase Deployer V3.0.1
      • OceanBase Deployer V3.0.0
    • V2.10
      • OceanBase Deployer V2.10.1
      • OceanBase Deployer V2.10.0
    • V2.9
      • OceanBase Deployer V2.9.2
      • OceanBase Deployer V2.9.1
      • OceanBase Deployer V2.9.0
    • V2.8
      • OceanBase Deployment Tool V2.8.0
    • V2.7
      • OceanBase Deployment Tool V2.7.0
    • V2.6
      • OceanBase Deployment Tool V2.6.2
      • OceanBase Deployment Tool V2.6.1
      • OceanBase Deployment Tool V2.6.0
    • V2.5
      • OceanBase Deployer V2.5.0
    • V2.4
      • OceanBase Deployer V2.4.0
    • V2.3
      • OceanBase Deployment Tool V2.3.1
      • OceanBase Deployer V2.3.0
    • V2.2
      • OceanBase Deployment Tool V2.2.0
    • V2.1
      • OceanBase Deployer V2.1.1
      • OceanBase Deployment Tool V2.1.0
    • V2.0
      • OceanBase Deployment Tool V2.0.1
      • OceanBase Deployment Tool V2.0.0
    • V1.6
      • OceanBase Deployer V1.6.2
      • OceanBase Deployer V1.6.1
      • OceanBase Deployer V1.6.0
    • V1.5
      • OceanBase Deployer V1.5.0
    • V1.4
      • OceanBase Deployer V1.4.0
    • V1.3
      • OceanBase Deployer V1.3.3
      • OceanBase Deployer V1.3.2
      • OceanBase Deployer V1.3.0
    • V1.2
      • OceanBase Deployer V1.2.1
      • OceanBase Deployer V1.2.0
  • Interactive deployment of OceanBase Database Community Edition
  • Deploy a Community Edition cluster using the obd graphical interface
  • Deploy a Community Edition cluster by using an obd configuration file

Download PDF

What is obdInstall obdQuick deployment of OceanBase DatabaseQuickly deploy OCPQuick deployment commandsCluster commandsCommand groupsImage and repository commandsTest command groupsTool commandsobdiag commandsBinlog service commandsHardware commandsLicense commandsPassword commandsTelemetry commandsUsage overviewOverviewPattern configuration rulesDeploy an OceanBase clusterDeploy OCPDeploy OMSChange componentsUpgrade OCPUpgrade OMSConfiguration fileUpgrade obdFAQError codesVersion rulesOceanBase Deploy V4.3.0OceanBase Deployment Tool V4.2.0OceanBase Deployer V4.1.0OceanBase Deployer V4.0.0OceanBase Deployer V3.6.0OceanBase Deployer V3.5.0OceanBase Deployer V3.4.0OceanBase Deployer V3.3.0OceanBase Deployer V3.2.2OceanBase Deployer V3.2.1OceanBase Deployer V3.2.0OceanBase Deployer V3.1.2OceanBase Deployer V3.1.1OceanBase Deployer V3.1.0OceanBase Deployer V3.0.1OceanBase Deployer V3.0.0OceanBase Deployer V2.10.1OceanBase Deployer V2.10.0OceanBase Deployer V2.9.2OceanBase Deployer V2.9.1OceanBase Deployer V2.9.0OceanBase Deployment Tool V2.8.0OceanBase Deployment Tool V2.7.0OceanBase Deployment Tool V2.6.2OceanBase Deployment Tool V2.6.1OceanBase Deployment Tool V2.6.0OceanBase Deployer V2.5.0OceanBase Deployer V2.4.0OceanBase Deployment Tool V2.3.1OceanBase Deployer V2.3.0OceanBase Deployment Tool V2.2.0OceanBase Deployer V2.1.1OceanBase Deployment Tool V2.1.0OceanBase Deployment Tool V2.0.1OceanBase Deployment Tool V2.0.0OceanBase Deployer V1.6.2OceanBase Deployer V1.6.1OceanBase Deployer V1.6.0OceanBase Deployer V1.5.0OceanBase Deployer V1.4.0OceanBase Deployer V1.3.3OceanBase Deployer V1.3.2OceanBase Deployer V1.3.0OceanBase Deployer V1.2.1OceanBase Deployer V1.2.0Interactive deployment of OceanBase Database Community EditionDeploy a Community Edition cluster using the obd graphical interfaceDeploy a Community Edition cluster by using an obd configuration file
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 Deployer
  3. V4.3.0
iconOceanBase Deployer
V 4.3.0Community 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
Community Edition
  • V 4.3.0
  • V 3.2.1
  • V 3.2.0
  • V 3.1.0
  • V 3.0.0
  • V 2.10.1
  • V 2.10.0
  • V 2.9.0
  • V 2.8.0
  • V 2.7.0
  • V 2.6.0
  • V 2.5.0
  • V 2.4.0
  • V 2.3.1
  • V 2.3.0
  • V 2.2.0
  • V 2.1.0
  • V 2.0.0
  • V 1.6.1

Upgrade OceanBase Database

Last Updated:2026-06-30 14:40:58  Updated
Share
What is on this page
Overview
Procedure

folded

Share

This topic describes how to use the obd command to upgrade OceanBase Database.

Overview

You can upgrade OceanBase Database by using obd in the following two ways. Choose a method based on your actual situation:

  • Method 1: If your server can access the Internet or your configured image repository contains the RPM packages for OceanBase Database updates, you can upgrade OceanBase Database by using the online upgrade method. For more information, see Method 1: Online upgrade.

  • Method 2: If your server cannot access the Internet and your configured image repository does not contain the RPM packages for OceanBase Database updates, you can add the RPM packages for OceanBase Database updates to the local image repository by running the obd mirror clone command, or download and install the all-in-one installation package for the corresponding version of OceanBase Database. Then, you can upgrade OceanBase Database. For more information, see Method 2: Offline upgrade.

Procedure

Note

  • If the tenant to be upgraded has a standby tenant, you must first upgrade the cluster where the standby tenant is located, or perform a switchover to switch the primary and standby tenants.

  • obd supports upgrading OceanBase clusters of Enterprise Edition and Community Edition. This topic describes how to upgrade an OceanBase cluster of Community Edition.

Method 1: Online upgrade
Method 2: Offline upgrade
  1. Run the following command to enable the remote image repository.

    obd mirror enable remote
    
  2. (Optional) Run the following command to upgrade obd to the latest version.

    obd update
    
  3. Run the following command to query the OceanBase Database version in the remote image repository.

    obd mirror list oceanbase.community.stable | grep oceanbase-ce
    

    The hash value corresponding to the oceanbase-ce version is the last column of the output.

    | oceanbase-ce                      | 3.1.0   | 1.el7                  | x86_64 | 9decc4788a7fc6cc2082ac1668f287f60f4a3b8d05a58da094605aa2f19d18fc |
    | oceanbase-ce                      | 3.1.0   | 2.el7                  | x86_64 | 642cceea884f64860f231701351efb9a1156c46664b49a65f82806f9dab704a2 |
    | oceanbase-ce                      | 3.1.0   | 3.el7                  | x86_64 | 9a21232c8ee420f6a5dad043ee12aed2efe9796478780ea04077622300b6bac8 |
    | oceanbase-ce                      | 3.1.1   | 1.el7                  | x86_64 | 37be8ed5ea3a263a5a509f0ee553a208a3d4b63887a8c81a2efda7256e4838e9 |
    | oceanbase-ce                      | 3.1.1   | 4.el7                  | x86_64 | d94d9856ec521fe0a54f21bb2a33739c20367e8388da937fd0fcd2e54364ae96 |
    | oceanbase-ce                      | 3.1.2   | 10000392021123010.el7  | x86_64 | f38723204d49057d3e062ffad778edc1552a7c114622bf2a86fea769fbd202ea |
    | oceanbase-ce                      | 3.1.3   | 10000292022032916.el7  | x86_64 | bb5dcd5d56e84a30bfecd4173455c84952819db7c37619c1cedbb375054f1acb |
    | oceanbase-ce                      | 3.1.3   | 10100032022041510.el7  | x86_64 | 589c4f8ed2662835148a95d5c1b46a07e36c2d346804791364a757aef4f7b60d |
    | oceanbase-ce                      | 3.1.4   | 100000112022102717.el7 | x86_64 | 25b25df19e27d0844fd3d0632da010b7ac33ac454144107ca8b10d337e2f4f68 |
    | oceanbase-ce                      | 3.1.4   | 10000092022071511.el7  | x86_64 | 30a7241f8781d306dc4d008f266e9321876b1e6448bbc4aaf15ab6631b5d2715 |
    | oceanbase-ce                      | 3.1.4   | 102000012022120715.el7 | x86_64 | 033f86169a145d76499eb2730dbd49c4e657ffbacd7bd7a860522d7981a68d6d |
    | oceanbase-ce                      | 3.1.4   | 103000102023020719.el7 | x86_64 | 6980507073d6e7b91fceb9549c0e68a767f47194d961112d73106e2f26952077 |
    | oceanbase-ce                      | 3.1.5   | 100000252023041721.el7 | x86_64 | d3629804ab753a7248a9ba80fb111f6594411820000aa7b3f958cda3f8b12dd4 |
    | oceanbase-ce                      | 4.0.0.0 | 100000272022110114.el7 | x86_64 | 759074414c7b7b723013855353f62a7ba0aae0f493216ef2511825850ce77b51 |
    | oceanbase-ce                      | 4.0.0.0 | 100000282022112511.el7 | x86_64 | debb18ab3c0b3d16f145c41cd21c30686863580b721d45ddaa068e6309e03b64 |
    | oceanbase-ce                      | 4.0.0.0 | 102000032022120718.el7 | x86_64 | c63bb73384b17d74299b34fe3aceb0ae310fd319d2ccdb1acd39f31ba6673198 |
    | oceanbase-ce                      | 4.0.0.0 | 103000022023011215.el7 | x86_64 | ca467ed00a5e717f40d360ba9d08252595f4ce9de87c81e6006858fbae5755fa |
    | oceanbase-ce                      | 4.1.0.0 | 100000192023032010.el7 | x86_64 | a4a092156b5cfe6708a25813633145e0bbd75170e01e30b5c4b88fb230e10903 |
    | oceanbase-ce                      | 4.1.0.0 | 100000202023040520.el7 | x86_64 | b56ec3d6e75fd01da65abe0ebb8f8b6455d6a8563c77491ee3d19b33abc40e53 |
    | oceanbase-ce                      | 4.1.0.0 | 101000022023050809.el7 | x86_64 | fe7c4d26f18534e4116f75ddf8ecea59bfdba221e6d43c0f7ea6a24c118c3858 |
    | oceanbase-ce                      | 4.1.0.0 | 101010022023051821.el7 | x86_64 | 66882706a45d94c379dce7fd6c0b3c9c33cd780e95658d3a475029013a4b3451 |
    | oceanbase-ce                      | 4.1.0.1 | 102000042023061314.el7 | x86_64 | 126aa046ed03e191aad2481b1e4f82f43bb0017befc3b9569f4c8e215313c8ef |
    | oceanbase-ce                      | 4.1.0.2 | 103010012023082519.el7 | x86_64 | 3473fe01f6c5325a29bd325183377d102ea1f9cf1cd8bb5a0f36fac9852983cf |
    | oceanbase-ce                      | 4.2.0.0 | 100000152023080109.el7 | x86_64 | 1cbd1fde8c6d7695015265da09738478c97e0e2f908fca6745dc9cc531860e74 |
    | oceanbase-ce                      | 4.2.0.0 | 100010022023081817.el7 | x86_64 | 5cb4adf7a98754c09a82edadaf8f9485bfd6376184e4fe3109e8f607899cf8cf |
    | oceanbase-ce                      | 4.2.0.0 | 100010032023083021.el7 | x86_64 | 790596d146bd22abfbd87faf6bcacddd0d6936dafe0ff6958640bdb833256a48 |
    # Omitted subsequent output
    
  4. (Optional) Check the primary_zone configuration of tenants in the cluster

    Note

    This step is required only when the target version is V4.0.x, V4.1.x, or V4.2.0 BETA.

    Log in to the sys tenant of the database as the root user and execute the following command to check the primary_zone configuration.

    obclient [oceanbase]> select * from __all_tenant;
    

    The output is as follows:

    +----------------------------+----------------------------+-----------+-------------+-------------------+--------------+--------+----------------+---------------+---------------------------------------------+-------------------+-----------------------+--------------------+------------------+--------+---------------+----------------------------+
    | gmt_create                 | gmt_modified               | tenant_id | tenant_name | zone_list         | primary_zone | locked | collation_type | info          | locality                                    | previous_locality | default_tablegroup_id | compatibility_mode | drop_tenant_time | status | in_recyclebin | arbitration_service_status |
    +----------------------------+----------------------------+-----------+-------------+-------------------+--------------+--------+----------------+---------------+---------------------------------------------+-------------------+-----------------------+--------------------+------------------+--------+---------------+----------------------------+
    | 2023-09-08 15:04:32.205665 | 2023-09-08 15:04:32.205665 |         1 | sys         | zone1;zone2;zone3 | RANDOM       |      0 |              0 | system tenant | FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3 |                   |                    -1 |                  0 |               -1 | NORMAL |             0 | DISABLED                   |
    | 2023-09-08 15:13:49.119008 | 2023-09-08 15:14:09.573693 |      1001 | META$1002   | zone1;zone2;zone3 | RANDOM       |      0 |              0 |               | FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3 |                   |                    -1 |                  0 |               -1 | NORMAL |             0 | DISABLED                   |
    | 2023-09-08 15:13:49.126607 | 2023-09-08 15:14:09.733515 |      1002 | ocp         | zone1;zone2;zone3 | RANDOM       |      0 |              0 |               | FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3 |                   |                    -1 |                  0 |               -1 | NORMAL |             0 | DISABLED                   |
    +----------------------------+----------------------------+-----------+-------------+-------------------+--------------+--------+----------------+---------------+---------------------------------------------+-------------------+-----------------------+--------------------+------------------+--------+---------------+----------------------------+
    

    Check whether the value of the primary_zone column for other tenants is RANDOM. If it is, execute the following command to configure different priorities for the zones of the tenant.

    obclient [oceanbase]> ALTER TENANT ocp primary_zone='zone1';
    
  5. Perform a major compaction on OceanBase Database

    Log in to the sys tenant of the database as the root user and execute the following command to perform a major compaction.

    obclient [oceanbase]> ALTER SYSTEM MAJOR FREEZE;
    

    Execute the following command to check whether the major compaction is completed.

    obclient [oceanbase]> select name,value from oceanbase.__all_zone where name='frozen_version' or name='last_merged_version';
    # or
    obclient [oceanbase]> SELECT * FROM oceanbase.CDB_OB_MAJOR_COMPACTION\G
    
  6. After the major compaction is completed, execute the following command to upgrade OceanBase Database.

    obd cluster upgrade obtest -c oceanbase-ce -V 4.2.0.0 --usable=790596d146bd22abfbd87faf6bcacddd0d6936dafe0ff6958640bdb833256a48
    

    Here is an example where the cluster name is obtest and the target version is 4.2.0. You need to replace the cluster name and target version with your actual values. For more information about the obd cluster upgrade command, see Cluster command groups.

  7. Verify whether the upgrade is successful.

    Log in to the sys tenant of OceanBase Database as the root user and execute the following command to check the database version.

    obclient [oceanbase]> SELECT version();
    
  1. Configure the RPM package

    You can add the RPM package of the updated OceanBase Database to the local image repository by using the obd mirror clone command, or you can download and install the all-in-one installation package of the corresponding version of OceanBase Database.

    • Method 1: Download the RPM packages of OceanBase Database and its dependent libraries from the releases note or OceanBase Software Download Center on GitHub, copy the RPM packages to the machine where obd is installed, and execute the following command in the directory where the RPM packages are stored to add the downloaded installation package to the local image repository.

      obd mirror clone oceanbase-ce-*.rpm
      
    • Method 2: Download the all-in-one installation package of the corresponding version of OceanBase Database from the OceanBase Software Download Center, copy the installation package to the machine where obd is installed, and execute the following command to decompress and install the package.

      Notice

      You must use the host account used for deploying OceanBase Database (such as admin) to install the all-in-one installation package.

      [admin@test001 ~]$ tar -xzf oceanbase-all-in-one-*.tar.gz
      [admin@test001 ~]$ cd oceanbase-all-in-one/bin/
      [admin@test001 bin]$ ./install.sh
      [admin@test001 bin]$ source ~/.oceanbase-all-in-one/bin/env.sh
      
  2. Execute the following command to disable the remote image repository.

    obd mirror disable remote
    
  3. Execute the following command to query the version of OceanBase Database in the local image repository.

    obd mirror list local | grep oceanbase-ce
    

    The output is as follows. The string in the last column is the hash value of the oceanbase-ce package of the corresponding version.

    | oceanbase-ce      | 4.1.0.1 | 102000042023061314.el7 | x86_64 | d03fafa6fa8ceb0636e4db05b5b5f6c3ac2256a3 |
    | oceanbase-ce-libs | 4.1.0.1 | 102000042023061314.el7 | x86_64 | c3f797aae1ce258ec9be77898b94e4e7a501cd0f |
    | oceanbase-ce      | 4.2.0.0 | 100010022023081817.el7 | x86_64 | bf178e82c99ca1324a3df9e1a21cbbb8f8c4d46c |
    | oceanbase-ce-libs | 4.2.0.0 | 100010022023081817.el7 | x86_64 | f77ba7e678acf0645889967391c847ca9cf684b6 |
    
  4. (Optional) Check the primary_zone configuration of tenants in the cluster

    Note

    This step is required only when the target version is V4.0.x, V4.1.x, or V4.2.0 BETA.

    Log in to the sys tenant of the database as the root user and execute the following command to check the primary_zone configuration.

    obclient [oceanbase]> select * from __all_tenant;
    

    The output is as follows:

    +----------------------------+----------------------------+-----------+-------------+-------------------+--------------+--------+----------------+---------------+---------------------------------------------+-------------------+-----------------------+--------------------+------------------+--------+---------------+----------------------------+
    | gmt_create                 | gmt_modified               | tenant_id | tenant_name | zone_list         | primary_zone | locked | collation_type | info          | locality                                    | previous_locality | default_tablegroup_id | compatibility_mode | drop_tenant_time | status | in_recyclebin | arbitration_service_status |
    +----------------------------+----------------------------+-----------+-------------+-------------------+--------------+--------+----------------+---------------+---------------------------------------------+-------------------+-----------------------+--------------------+------------------+--------+---------------+----------------------------+
    | 2023-09-08 15:04:32.205665 | 2023-09-08 15:04:32.205665 |         1 | sys         | zone1;zone2;zone3 | RANDOM       |      0 |              0 | system tenant | FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3 |                   |                    -1 |                  0 |               -1 | NORMAL |             0 | DISABLED                   |
    | 2023-09-08 15:13:49.119008 | 2023-09-08 15:14:09.573693 |      1001 | META$1002   | zone1;zone2;zone3 | RANDOM       |      0 |              0 |               | FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3 |                   |                    -1 |                  0 |               -1 | NORMAL |             0 | DISABLED                   |
    | 2023-09-08 15:13:49.126607 | 2023-09-08 15:14:09.733515 |      1002 | ocp         | zone1;zone2;zone3 | RANDOM       |      0 |              0 |               | FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3 |                   |                    -1 |                  0 |               -1 | NORMAL |             0 | DISABLED                   |
    +----------------------------+----------------------------+-----------+-------------+-------------------+--------------+--------+----------------+---------------+---------------------------------------------+-------------------+-----------------------+--------------------+------------------+--------+---------------+----------------------------+
    

    Check whether the value of the primary_zone column for other tenants is RANDOM. If it is, execute the following command to configure different priorities for the zones of the tenant.

    obclient [oceanbase]> ALTER TENANT ocp primary_zone='zone1';
    

    For more information about the ALTER TENANT command, see ALTER TENANT in the OceanBase Database documentation.

  5. Perform a major compaction on OceanBase Database

    Log in to the sys tenant of the database as the root user and execute the following command to perform a major compaction.

    obclient [oceanbase]> ALTER SYSTEM MAJOR FREEZE;
    

    Execute the following command to check whether the major compaction is completed.

    obclient [oceanbase]> select name,value from oceanbase.__all_zone where name='frozen_version' or name='last_merged_version';
    # or
    obclient [oceanbase]> SELECT * FROM oceanbase.CDB_OB_MAJOR_COMPACTION\G
    

    For more information about the output fields of the oceanbase.CDB_OB_MAJOR_COMPACTION view, see oceanbase.CDB_OB_MAJOR_COMPACTION in the OceanBase Database documentation.

  6. After the major compaction is completed, execute the following command to upgrade OceanBase Database:

    obd cluster upgrade obtest -c oceanbase-ce -V 4.2.0.0 --usable=bf178e82c99ca1324a3df9e1a21cbbb8f8c4d46c
    

    Here is an example where the cluster name is obtest and the target upgrade version is 4.2.0. You need to replace the cluster name and target upgrade version with your actual values. For more information about the commands used in this step, see the obd cluster upgrade command in Cluster command groups.

  7. Verify whether the upgrade is successful.

    Log in to the sys tenant of OceanBase Database as the root user and execute the following command to view the database version.

    obclient [oceanbase]> SELECT version();
    

Previous topic

Take over an OceanBase cluster
Last

Next topic

Upgrade ODP
Next
What is on this page
Overview
Procedure