If you restore a standby tenant from backup files of OceanBase Database to a cluster of a later version, after you convert the standby tenant into the primary tenant, you must upgrade the tenant.
Limitations
Only OceanBase Database V4.1.0.0 and later allow you to upgrade a restored tenant.
This feature is not supported for quick restore.
Prerequisites
The restored standby tenant has been converted into to the primary tenant. For more information, see Convert a standby tenant into primary tenant.
Procedure
Log in as the
rootuser to thesystenant of the cluster where the restored tenant resides.Execute the following statement to upgrade the restored tenant:
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 = 'UPGRADE_ALL' AND value3 ='4.2.1.1' AND value5 = '1004';where
4.2.1.1indicates the four-digit version number of the current cluster.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.