If you restore a standby tenant from backup files of OceanBase Database to a cluster of a later version, after you change the role of the tenant to PRIMARY, you must upgrade the restored tenant.
Limitations
Only OceanBase Database V4.1.0.0 and later allow you to upgrade a restored tenant.
Prerequisites
The role of the restored standby tenant has been changed to PRIMARY. For more information, see Change the role of a standby tenant to PRIMARY.
Procedure
Log on as the
rootuser to thesystenant of the cluster where the restored tenant resides.Run the upgrade command to upgrade the restored tenant.
The syntax is as follows:
ALTER SYSTEM RUN UPGRADE JOB "UPGRADE_ALL" TENANT = tenant_name;Here,
tenant_namespecifies the name of the restored tenant. You can upgrade multiple tenants at a time. Separate the tenant names with commas (,).After the upgrade, check whether the tenant is successfully upgraded. The query statement varies with the version of the current OceanBase cluster.
When the current OceanBase cluster is of a version earlier than V4.2.1.1:
A sample query statement is as follows:
obclient [(none)]> SELECT distinct(value) FROM oceanbase.GV$OB_PARAMETERS WHERE tenant_id =1004;Here,
1004is thetenant_idvalue of the upgraded tenant. You can obtain the value oftenant_idby querying theDBA_OB_TENANTSview.If the query result is a row and the
valuecolumn displays the four-digit version number of the current cluster, such as 4.2.1.0, the tenant upgrade is successful.When the current OceanBase cluster is of V4.2.1.1 or later:
A sample query statement is as follows:
obclient [(none)]> SELECT count(*) FROM oceanbase.DBA_OB_CLUSTER_EVENT_HISTORY WHERE event = 'UPTRADE_ALL' AND value3 ='4.2.1.1' AND value5 = '1004';The parameter values are described as follows:
4.2.1.1indicates the four-digit version number of the current cluster. For more information about how to view the version number, see Versioning rules.1004is thetenant_idvalue of the upgraded tenant. You can obtain the value oftenant_idby querying theDBA_OB_TENANTSview.
If the query result is not
0, the tenant is successfully upgraded.