OceanBase
English日本語简体中文
Docs Home
Products
Integrations
Release Notes

Databases

OceanBase DatabaseOceanBase Cloud OceanBase Best Practices

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog Service

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Databases

OceanBase DatabaseOceanBase Cloud OceanBase Best Practices

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog Service
OceanBase DatabaseOceanBase Cloud ToolsConnectors and MiddlewareLifecycle Support Policy

OceanBase Deployer

V2.10.0Community Edition
  • What is obd
  • Quick Start
    • Install obd
    • Quickly deploy OceanBase Database
    • Quickly deploy OCP
    • Deploy an OceanBase cluster on the GUI
  • obd Command
    • Quick deployment command
    • Cluster commands
    • Mirror and repository commands
    • Testing commands
    • Tool commands
    • obdiag commands
    • Telemetry commands
  • User Guide
    • Configuration files
    • Deploy through GUI
      • GUI operation overview
      • Deploy OCP through the GUI
      • Modify components on the GUI
    • Deploy through CLI
      • Deploy OceanBase Database on a single server
      • Deploy OCP Express by using commands
      • Deploy and use obconfigserver
      • Deploy oblogproxy by using the CLI
      • Deploy OCP by using commands
      • Use OCP to take over a cluster deployed by obd
      • Use obd to take over a cluster
      • Add GUI-based monitoring for an existing cluster
      • Upgrade OCP Express
      • Upgrade OceanBase Database
      • Physical Standby Database
        • Deploy primary and standby tenants by using obd
        • Switch the roles of tenants and decouple a standby tenant from the primary tenant
      • Scale out a cluster and change cluster components
      • Performance test
      • Cluster diagnotistics
  • FAQ
    • FAQ
    • How do I upgrade an OBProxy to obproxy-ce 3.2.3?
  • Mode configuration rules
  • Error codes
  • Release Notes
    • Version rules
    • V2.10
      • 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 Deployer V2.8.0
    • V2.7
      • OceanBase Deployer V2.7.0
    • V2.6
      • OceanBase Deployer V2.6.2
      • OceanBase Deployer V2.6.1
      • OceanBase Deployer V2.6.0
    • V2.5
      • OceanBase Deployer V2.5.0
    • V2.4
      • OceanBase Deployer V2.4.0
    • V2.3
      • OceanBase Deployer V2.3.1
      • OceanBase Deployer V2.3.0
    • V2.2
      • OceanBase Deployer V2.2.0
    • V2.1
      • OceanBase Deployer V2.1.1
      • OceanBase Deployer V2.1.0
    • V2.0
      • OceanBase Deployer V2.0.1
      • OceanBase Deployer 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

Download PDF

Document Feedback
  1. Documentation Center
  2. OceanBase Deployer
  3. V2.10.0

Upgrade OceanBase Database

Last Updated:2026-10-09 07:33:59

Introduction
Procedure

This topic describes how to upgrade OceanBase Database by using OceanBase Deployer (obd).

Introduction

There are two solutions for upgrading OceanBase Database using obd, and you can choose the appropriate one based on your actual situation:

  • Solution 1: If your server can access the Internet or you have configured an image repository that has the RPM package for upgrading OceanBase Database, you can use this solution for the upgrade. For more information, see Solution 1: upgrade OceanBase Database online.

  • Solution 2: If your server cannot access the Internet and the configured image repository does not contain an RPM package for upgrading OceanBase Database, you can run the obd mirror clone command to add the RPM package for upgrading OceanBase Database to the local image repository, or download and install the OceanBase all-in-one installation package of the corresponding version, and then upgrade OceanBase Database. For more information, see Solution 2: upgrade OceanBase Database offline.

Procedure

Note

If a tenant in the cluster 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 between the primary and standby tenants.

Solution 1: upgrade OceanBase Database online
Solution 2: upgrade OceanBase Database offline
  1. Run the following command to connect to 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 version of OceanBase Database in the remote mirror repository:

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

    In the following sample output, the strings displayed in the rightmost column are the hash values of the corresponding versions of OceanBase Database Community Edition.

    | 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 |
    # Subsequent outputs omitted
    
  4. Optional. View the primary zone configuration of tenants in the cluster.

    Note

    This step is required only when you upgrade OceanBase Database to V4.0.x, V4.1.x, or V4.2.0 BETA.

    Log on to the sys tenant of the database as the root user and run the following command:

    obclient [oceanbase]> select * from __all_tenant;
    

    Output:

    +----------------------------+----------------------------+-----------+-------------+-----------+--------------+--------+----------------+---------------+---------------+-------------------+-----------------------+--------------------+------------------+--------+---------------+----------------------------+
    | 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-04-28 16:39:24.019437 | 2023-04-28 16:39:24.019437 |         1 | sys         | zone1     | RANDOM       |      0 |              0 | system tenant | FULL{1}@zone1 |                   |                    -1 |                  0 |               -1 | NORMAL |             0 | DISABLED                   |
    | 2023-04-28 16:39:35.803601 | 2023-04-28 16:39:48.801686 |      1001 | META$1002   | zone1     | RANDOM       |      0 |              0 |               | FULL{1}@zone1 |                   |                    -1 |                  0 |               -1 | NORMAL |             0 | DISABLED                   |
    | 2023-04-28 16:39:35.812822 | 2023-04-28 16:39:48.823722 |      1002 | ocp         | zone1     | RANDOM       |      0 |              0 |               | FULL{1}@zone1 |                   |                    -1 |                  0 |               -1 | NORMAL |             0 | DISABLED                   |
    +----------------------------+----------------------------+-----------+-------------+-----------+--------------+--------+----------------+---------------+---------------+-------------------+-----------------------+--------------------+------------------+--------+---------------+----------------------------+
    

    Check whether the value of the primary_zone column for tenants other than the sys tenant in the output is RANDOM. If yes, run the following command to configure different priorities for the zones in the tenant:

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

    For more information about the ALTER TENANT statement, see ALTER TENANT.

  5. Perform a major compaction of OceanBase Database.

    Log on to the sys tenant as the root user and run the following command to perform a major compaction:

    obclient [oceanbase]> ALTER SYSTEM MAJOR FREEZE;
    

    Run 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 oceanbase.CDB_OB_MAJOR_COMPACTION view, see oceanbase.CDB_OB_MAJOR_COMPACTION.

  6. Run the following command to upgrade OceanBase Database:

    obd cluster upgrade obtest -c oceanbase-ce -V 4.1.0.0 --usable=b56ec3d6e75fd01da65abe0ebb8f8b6455d6a8563c77491ee3d19b33abc40e53
    

    For more information about the commands used in this step, see Cluster commands.

  7. Verify the upgrade

    Log on to the sys tenant of OceanBase Database as the root user and execute the following statement to view the database version:

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

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

    • Method 1: Download the RPM packages of OceanBase Database and the required dependency library from the Releases page on GitHub or OceanBase Download Center, copy the packages to the server where obd is installed, and run the following command in the directory where the packages are located to add the packages to the local image repository:

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

      Notice

      You must install the all-in-one installation package with the same account that you use to install OceanBase Database.

      [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. Run the following command to disconnect from the remote image repository:

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

    obd mirror list local | grep oceanbase-ce
    

    In the following sample output, the strings displayed in the rightmost column are the hash values of the corresponding versions of OceanBase Database Community Edition.

    | oceanbase-ce      | 4.1.0.0 | 100000192023032010.el7 | x86_64 | 8439ecf8db5e0649bd49671b41ea9e8c85756b63 |
    | oceanbase-ce      | 4.1.0.0 | 100000202023040520.el7 | x86_64 | d598937b1cfb1df85e2c2231acf024e4994db533 |
    | oceanbase-ce-libs | 4.1.0.0 | 100000192023032010.el7 | x86_64 | a83b1dd1cab44d3f610d439931322be7a08555f2 |
    | oceanbase-ce-libs | 4.1.0.0 | 100000202023040520.el7 | x86_64 | 5d24535db655b4dce6fc62aedc4d0e867225792a |
    
  4. Optional. View the primary zone configuration of tenants in the cluster.

    Note

    This step is required only when you upgrade OceanBase Database to V4.0.x, V4.1.x, or V4.2.0 BETA.

    Log on to the sys tenant of the database as the root user and run the following command:

    obclient [oceanbase]> select * from __all_tenant;
    

    Output:

    +----------------------------+----------------------------+-----------+-------------+-----------+--------------+--------+----------------+---------------+---------------+-------------------+-----------------------+--------------------+------------------+--------+---------------+----------------------------+
    | 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-04-28 16:39:24.019437 | 2023-04-28 16:39:24.019437 |         1 | sys         | zone1     | RANDOM       |      0 |              0 | system tenant | FULL{1}@zone1 |                   |                    -1 |                  0 |               -1 | NORMAL |             0 | DISABLED                   |
    | 2023-04-28 16:39:35.803601 | 2023-04-28 16:39:48.801686 |      1001 | META$1002   | zone1     | RANDOM       |      0 |              0 |               | FULL{1}@zone1 |                   |                    -1 |                  0 |               -1 | NORMAL |             0 | DISABLED                   |
    | 2023-04-28 16:39:35.812822 | 2023-04-28 16:39:48.823722 |      1002 | ocp         | zone1     | RANDOM       |      0 |              0 |               | FULL{1}@zone1 |                   |                    -1 |                  0 |               -1 | NORMAL |             0 | DISABLED                   |
    +----------------------------+----------------------------+-----------+-------------+-----------+--------------+--------+----------------+---------------+---------------+-------------------+-----------------------+--------------------+------------------+--------+---------------+----------------------------+
    

    Check whether the value of the primary_zone column for tenants other than the sys tenant in the output is RANDOM. If yes, run the following command to configure different priorities for the zones in the tenant:

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

    For more information about the ALTER TENANT statement, see ALTER TENANT.

  5. Perform a major compaction of OceanBase Database

    Log on to the sys tenant as the root user and run the following command to perform a major compaction:

    obclient [oceanbase]> ALTER SYSTEM MAJOR FREEZE;
    

    Run 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 oceanbase.CDB_OB_MAJOR_COMPACTION view, see oceanbase.CDB_OB_MAJOR_COMPACTION.

  6. Run the following command to upgrade OceanBase Database:

    obd cluster upgrade obtest -c oceanbase-ce -V 4.1.0.0 --usable=d598937b1cfb1df85e2c2231acf024e4994db533
    

    For more information about the commands used in this step, see Cluster commands.

  7. Verify the upgrade

    Log on to the sys tenant of OceanBase Database as the root user and execute the following statement to view the database version:

    obclient [oceanbase]> SELECT version();
    

Previous topic

Upgrade OCP Express
Last

Next topic

Deploy primary and standby tenants by using obd
Next
on this page
Introduction
Procedure