This topic describes how to modify the number of primary zones for a tenant to implement tenant scaling.
Prerequisites
Before you modify the number of primary zones for a tenant, enable load balancing for the tenant. The load balancing strategy for a tenant is jointly controlled by the tenant-level parameters enable_rebalance and enable_transfer.
You can specify the enable_rebalance parameter in the sys tenant to control whether to enable load balancing among tenants, and specify this parameter in a user tenant to control whether to enable load balancing for the current tenant. The default value is true. The setting takes effect immediately without the need to restart the OBServer node.
You can specify the enable_transfer parameter to control whether to enable the transfer feature for a tenant. The default value is true. The setting takes effect immediately without the need to restart the OBServer node. The enable_transfer parameter depends on the value of the enable_rebalance parameter.
If the value of the
enable_rebalanceparameter isfalse, theenable_transferparameter does not take effect.If the value of
enable_rebalanceistrueand the value ofenable_transferistrue, the system automatically adjusts partition distribution to achieve load balancing during a tenant scaling operation.If the value of
enable_rebalanceistrueand the value ofenable_transferisfalse, the system does not automatically adjust partition distribution during a tenant scaling operation, and load balancing is not automatically implemented.
You can enable load balancing for a tenant in the following ways:
Enable load balancing for a specified tenant from the sys tenant
Enable load balancing and the transfer feature for a specified tenant from the sys tenant
ALTER SYSTEM SET enable_rebalance = true TENANT = 'tenant_name';ALTER SYSTEM SET enable_transfer = true TENANT = 'tenant_name';These statements only set the values of the
enable_rebalanceandenable_transferparameters totruefor the specified user tenant.Enable intra-tenant load balancing and the transfer feature for all user tenants from the sys tenant``
ALTER SYSTEM SET enable_rebalance = true TENANT = all_user;ALTER SYSTEM SET enable_transfer = true TENANT = all_user;or
ALTER SYSTEM SET enable_rebalance = true TENANT = all;ALTER SYSTEM SET enable_transfer = true TENANT = all;These statements only set the values of the
enable_rebalanceandenable_transferparameters totruefor all user tenants.
Note
In OceanBase Database V4.2.1 and later, the
TENANT = all_userandTENANT = allsettings express the same semantics. If you want an operation to take effect on all user tenants, we recommend that you useTENANT = all_user.TENANT = allwill be deprecated.Enable load balancing for a user tenant from the current tenant
You can execute the following statements to enable load balancing and the transfer feature for the current user tenant:
ALTER SYSTEM SET enable_rebalance = true;ALTER SYSTEM SET enable_transfer = true;
For more information about the enable_rebalance and enable_transfer parameters, see enable_rebalance and enable_transfer, respectively.
Add a primary zone
Log on to the
systenant of the cluster as therootuser.obclient -h172.30.xxx.xxx -P2883 -uroot@sys#obdemo -pxxxx -AAccess the database named
oceanbase.use oceanbase;Query the basic information about the
mysql001tenant, such as thelocalityandprimary zoneattributes.SELECT * FROM oceanbase.DBA_OB_TENANTS WHERE tenant_id = 1006;A sample query result is as follows:
+-----------+-------------+-------------+----------------------------+----------------------------+-------------------+---------------------------------------------+-------------------+--------------------+--------+---------------+--------+-------------+-------------------+------------------+---------------------+---------------------+---------------------+---------------------+--------------+----------------------------+----------+------------+-----------+ | TENANT_ID | TENANT_NAME | TENANT_TYPE | CREATE_TIME | MODIFY_TIME | PRIMARY_ZONE | LOCALITY | PREVIOUS_LOCALITY | COMPATIBILITY_MODE | STATUS | IN_RECYCLEBIN | LOCKED | TENANT_ROLE | SWITCHOVER_STATUS | SWITCHOVER_EPOCH | SYNC_SCN | REPLAYABLE_SCN | READABLE_SCN | RECOVERY_UNTIL_SCN | LOG_MODE | ARBITRATION_SERVICE_STATUS | UNIT_NUM | COMPATIBLE | MAX_LS_ID | +-----------+-------------+-------------+----------------------------+----------------------------+-------------------+---------------------------------------------+-------------------+--------------------+--------+---------------+--------+-------------+-------------------+------------------+---------------------+---------------------+---------------------+---------------------+--------------+----------------------------+----------+------------+-----------+ | 1006 | mysql001 | USER | 2023-09-25 17:06:51.025654 | 2023-09-25 17:07:31.606415 | zone1;zone2;zone3 | FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3 | NULL | MYSQL | NORMAL | NO | NO | PRIMARY | NORMAL | 0 | 1695633705492686782 | 1695633705492686782 | 1695633705492686782 | 4611686018427387903 | NOARCHIVELOG | DISABLED | 2 | 4.2.1.0 | 1002 | +-----------+-------------+-------------+----------------------------+----------------------------+-------------------+---------------------------------------------+-------------------+--------------------+--------+---------------+--------+-------------+-------------------+------------------+---------------------+---------------------+---------------------+---------------------+--------------+----------------------------+----------+------------+-----------+ 1 row in setQuery the number of resource units of the
mysql001tenant. In this example, the value ofUNIT_NUMis2, indicating that the tenant has two resource units in each zone.SELECT * FROM oceanbase.DBA_OB_UNITS WHERE tenant_id = 1006;A sample query result is as follows:
+---------+-----------+--------+------------------+---------------+----------------------------+----------------------------+-------+----------------+----------+---------------------+-----------------------+----------------+----------------+---------+---------+-------------+---------------+---------------------+---------------------+-------------+ | UNIT_ID | TENANT_ID | STATUS | RESOURCE_POOL_ID | UNIT_GROUP_ID | CREATE_TIME | MODIFY_TIME | ZONE | SVR_IP | SVR_PORT | MIGRATE_FROM_SVR_IP | MIGRATE_FROM_SVR_PORT | MANUAL_MIGRATE | UNIT_CONFIG_ID | MAX_CPU | MIN_CPU | MEMORY_SIZE | LOG_DISK_SIZE | MAX_IOPS | MIN_IOPS | IOPS_WEIGHT | +---------+-----------+--------+------------------+---------------+----------------------------+----------------------------+-------+----------------+----------+---------------------+-----------------------+----------------+----------------+---------+---------+-------------+---------------+---------------------+---------------------+-------------+ | 1016 | 1006 | ACTIVE | 1003 | 1006 | 2023-09-25 17:06:38.569419 | 2023-09-25 17:06:51.030929 | zone1 | xxx.xx.xxx.194 | 2882 | NULL | NULL | NULL | 1002 | 1 | 1 | 5368709120 | 16106127360 | 9223372036854775807 | 9223372036854775807 | 1 | | 1017 | 1006 | ACTIVE | 1003 | 1007 | 2023-09-25 17:06:38.571540 | 2023-09-25 17:06:51.030929 | zone1 | xxx.xx.xxx.198 | 2882 | NULL | NULL | NULL | 1002 | 1 | 1 | 5368709120 | 16106127360 | 9223372036854775807 | 9223372036854775807 | 1 | | 1018 | 1006 | ACTIVE | 1003 | 1006 | 2023-09-25 17:06:38.573614 | 2023-09-25 17:06:51.030929 | zone2 | xxx.xx.xxx.192 | 2882 | NULL | NULL | NULL | 1002 | 1 | 1 | 5368709120 | 16106127360 | 9223372036854775807 | 9223372036854775807 | 1 | | 1019 | 1006 | ACTIVE | 1003 | 1007 | 2023-09-25 17:06:38.575723 | 2023-09-25 17:06:51.030929 | zone2 | xxx.xx.xxx.196 | 2882 | NULL | NULL | NULL | 1002 | 1 | 1 | 5368709120 | 16106127360 | 9223372036854775807 | 9223372036854775807 | 1 | | 1020 | 1006 | ACTIVE | 1003 | 1006 | 2023-09-25 17:06:38.579946 | 2023-09-25 17:06:51.031986 | zone3 | xxx.xx.xxx.204 | 2882 | NULL | NULL | NULL | 1002 | 1 | 1 | 5368709120 | 16106127360 | 9223372036854775807 | 9223372036854775807 | 1 | | 1021 | 1006 | ACTIVE | 1003 | 1007 | 2023-09-25 17:06:38.581002 | 2023-09-25 17:06:51.031986 | zone3 | xxx.xx.xxx.197 | 2882 | NULL | NULL | NULL | 1002 | 1 | 1 | 5368709120 | 16106127360 | 9223372036854775807 | 9223372036854775807 | 1 | +---------+-----------+--------+------------------+---------------+----------------------------+----------------------------+-------+----------------+----------+---------------------+-----------------------+----------------+----------------+---------+---------+-------------+---------------+---------------------+---------------------+-------------+ 6 rows in setChange the value of the
PRIMARY_ZONEattribute from1to2for themysql001tenant.ALTER TENANT mysql001 PRIMARY_ZONE='zone1,zone2;zone3';View the execution status of the task for adding a primary zone.
SELECT * FROM oceanbase.DBA_OB_TENANT_JOBS WHERE JOB_TYPE='ALTER_TENANT_PRIMARY_ZONE' AND tenant_id = 1006;A sample query result is as follows:
+--------+---------------------------+------------+-------------+----------+----------------------------+----------------------------+-----------+--------------------------------------------------------+-------------------+----------------+-------------+ | JOB_ID | JOB_TYPE | JOB_STATUS | RESULT_CODE | PROGRESS | START_TIME | MODIFY_TIME | TENANT_ID | SQL_TEXT | EXTRA_INFO | RS_SVR_IP | RS_SVR_PORT | +--------+---------------------------+------------+-------------+----------+----------------------------+----------------------------+-----------+--------------------------------------------------------+-------------------+----------------+-------------+ | 4 | ALTER_TENANT_PRIMARY_ZONE | SUCCESS | 0 | 100 | 2023-09-25 17:26:00.069089 | 2023-09-25 17:26:20.919021 | 1006 | ALTER TENANT mysql001 PRIMARY_ZONE='zone1,zone2;zone3' | zone1;zone2;zone3 | xxx.xx.xxx.196 | 2882 | +--------+---------------------------+------------+-------------+----------+----------------------------+----------------------------+-----------+--------------------------------------------------------+-------------------+----------------+-------------+ 1 row in setIn the query result, find the corresponding task record based on the following fields:
START_TIME: the time when the task was initiated.SQL_TEXT: the SQL statement corresponding to the task.EXTRA_INFO: the primary zone information before or after the modification.
If the value of
JOB_STATUSisSUCCESSin the corresponding task record, the task for adding the primary zone is successfully executed.For more information about the fields in the
DBA_OB_TENANT_JOBSview, see DBA_OB_TENANT_JOBS.Query the basic information of the
mysql001tenant. The zones with the highest priority change fromzone1tozone1,zone2.SELECT * FROM oceanbase.DBA_OB_TENANTS WHERE tenant_id = 1006;A sample query result is as follows:
+-----------+-------------+-------------+----------------------------+----------------------------+-------------------+---------------------------------------------+-------------------+--------------------+--------+---------------+--------+-------------+-------------------+------------------+---------------------+---------------------+---------------------+---------------------+--------------+----------------------------+----------+------------+-----------+ | TENANT_ID | TENANT_NAME | TENANT_TYPE | CREATE_TIME | MODIFY_TIME | PRIMARY_ZONE | LOCALITY | PREVIOUS_LOCALITY | COMPATIBILITY_MODE | STATUS | IN_RECYCLEBIN | LOCKED | TENANT_ROLE | SWITCHOVER_STATUS | SWITCHOVER_EPOCH | SYNC_SCN | REPLAYABLE_SCN | READABLE_SCN | RECOVERY_UNTIL_SCN | LOG_MODE | ARBITRATION_SERVICE_STATUS | UNIT_NUM | COMPATIBLE | MAX_LS_ID | +-----------+-------------+-------------+----------------------------+----------------------------+-------------------+---------------------------------------------+-------------------+--------------------+--------+---------------+--------+-------------+-------------------+------------------+---------------------+---------------------+---------------------+---------------------+--------------+----------------------------+----------+------------+-----------+ | 1006 | mysql001 | USER | 2023-09-25 17:06:51.025654 | 2023-09-25 17:26:00.072130 | zone1,zone2;zone3 | FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3 | NULL | MYSQL | NORMAL | NO | NO | PRIMARY | NORMAL | 0 | 1695634420875364980 | 1695634420875364980 | 1695634420875364980 | 4611686018427387903 | NOARCHIVELOG | DISABLED | 2 | 4.2.1.0 | 1004 | +-----------+-------------+-------------+----------------------------+----------------------------+-------------------+---------------------------------------------+-------------------+--------------------+--------+---------------+--------+-------------+-------------------+------------------+---------------------+---------------------+---------------------+---------------------+--------------+----------------------------+----------+------------+-----------+ 1 row in setQuery the resource units of the
mysql001tenant.In this example, the value of
UNIT_NUMremains unchanged.SELECT * FROM oceanbase.DBA_OB_UNITS WHERE tenant_id = 1006;A sample query result is as follows:
+---------+-----------+--------+------------------+---------------+----------------------------+----------------------------+-------+----------------+----------+---------------------+-----------------------+----------------+----------------+---------+---------+-------------+---------------+---------------------+---------------------+-------------+ | UNIT_ID | TENANT_ID | STATUS | RESOURCE_POOL_ID | UNIT_GROUP_ID | CREATE_TIME | MODIFY_TIME | ZONE | SVR_IP | SVR_PORT | MIGRATE_FROM_SVR_IP | MIGRATE_FROM_SVR_PORT | MANUAL_MIGRATE | UNIT_CONFIG_ID | MAX_CPU | MIN_CPU | MEMORY_SIZE | LOG_DISK_SIZE | MAX_IOPS | MIN_IOPS | IOPS_WEIGHT | +---------+-----------+--------+------------------+---------------+----------------------------+----------------------------+-------+----------------+----------+---------------------+-----------------------+----------------+----------------+---------+---------+-------------+---------------+---------------------+---------------------+-------------+ | 1016 | 1006 | ACTIVE | 1003 | 1006 | 2023-09-25 17:06:38.569419 | 2023-09-25 17:06:51.030929 | zone1 | xxx.xx.xxx.194 | 2882 | NULL | NULL | NULL | 1002 | 1 | 1 | 5368709120 | 16106127360 | 9223372036854775807 | 9223372036854775807 | 1 | | 1017 | 1006 | ACTIVE | 1003 | 1007 | 2023-09-25 17:06:38.571540 | 2023-09-25 17:06:51.030929 | zone1 | xxx.xx.xxx.198 | 2882 | NULL | NULL | NULL | 1002 | 1 | 1 | 5368709120 | 16106127360 | 9223372036854775807 | 9223372036854775807 | 1 | | 1018 | 1006 | ACTIVE | 1003 | 1006 | 2023-09-25 17:06:38.573614 | 2023-09-25 17:06:51.030929 | zone2 | xxx.xx.xxx.192 | 2882 | NULL | NULL | NULL | 1002 | 1 | 1 | 5368709120 | 16106127360 | 9223372036854775807 | 9223372036854775807 | 1 | | 1019 | 1006 | ACTIVE | 1003 | 1007 | 2023-09-25 17:06:38.575723 | 2023-09-25 17:06:51.030929 | zone2 | xxx.xx.xxx.196 | 2882 | NULL | NULL | NULL | 1002 | 1 | 1 | 5368709120 | 16106127360 | 9223372036854775807 | 9223372036854775807 | 1 | | 1020 | 1006 | ACTIVE | 1003 | 1006 | 2023-09-25 17:06:38.579946 | 2023-09-25 17:06:51.031986 | zone3 | xxx.xx.xxx.204 | 2882 | NULL | NULL | NULL | 1002 | 1 | 1 | 5368709120 | 16106127360 | 9223372036854775807 | 9223372036854775807 | 1 | | 1021 | 1006 | ACTIVE | 1003 | 1007 | 2023-09-25 17:06:38.581002 | 2023-09-25 17:06:51.031986 | zone3 | xxx.xx.xxx.197 | 2882 | NULL | NULL | NULL | 1002 | 1 | 1 | 5368709120 | 16106127360 | 9223372036854775807 | 9223372036854775807 | 1 | +---------+-----------+--------+------------------+---------------+----------------------------+----------------------------+-------+----------------+----------+---------------------+-----------------------+----------------+----------------+---------+---------+-------------+---------------+---------------------+---------------------+-------------+ 6 rows in set
In the preceding example, the number of primary zones is changed from 1 to 2 for the mysql001 tenant. The tenant has two resource units in each zone before the change. After the change, the tenant still has two resource units in each zone but the number of primary zones changes from 1 to 2.
Remove a primary zone
Log on to the
systenant of the cluster as therootuser.obclient -h172.30.xxx.xxx -P2883 -uroot@sys#obdemo -pxxxx -AAccess the database named
oceanbase.use oceanbase;Query the basic information about the
mysql001tenant, such as thelocalityandprimary zoneattributes.SELECT * FROM oceanbase.DBA_OB_TENANTS WHERE tenant_id = 1006;A sample query result is as follows:
+-----------+-------------+-------------+----------------------------+----------------------------+-------------------+---------------------------------------------+-------------------+--------------------+--------+---------------+--------+-------------+-------------------+------------------+---------------------+---------------------+---------------------+---------------------+--------------+----------------------------+----------+------------+-----------+ | TENANT_ID | TENANT_NAME | TENANT_TYPE | CREATE_TIME | MODIFY_TIME | PRIMARY_ZONE | LOCALITY | PREVIOUS_LOCALITY | COMPATIBILITY_MODE | STATUS | IN_RECYCLEBIN | LOCKED | TENANT_ROLE | SWITCHOVER_STATUS | SWITCHOVER_EPOCH | SYNC_SCN | REPLAYABLE_SCN | READABLE_SCN | RECOVERY_UNTIL_SCN | LOG_MODE | ARBITRATION_SERVICE_STATUS | UNIT_NUM | COMPATIBLE | MAX_LS_ID | +-----------+-------------+-------------+----------------------------+----------------------------+-------------------+---------------------------------------------+-------------------+--------------------+--------+---------------+--------+-------------+-------------------+------------------+---------------------+---------------------+---------------------+---------------------+--------------+----------------------------+----------+------------+-----------+ | 1006 | mysql001 | USER | 2023-09-25 17:06:51.025654 | 2023-09-25 17:26:00.072130 | zone1,zone2;zone3 | FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3 | NULL | MYSQL | NORMAL | NO | NO | PRIMARY | NORMAL | 0 | 1695634420875364980 | 1695634420875364980 | 1695634420875364980 | 4611686018427387903 | NOARCHIVELOG | DISABLED | 2 | 4.2.1.0 | 1004 | +-----------+-------------+-------------+----------------------------+----------------------------+-------------------+---------------------------------------------+-------------------+--------------------+--------+---------------+--------+-------------+-------------------+------------------+---------------------+---------------------+---------------------+---------------------+--------------+----------------------------+----------+------------+-----------+ 1 row in setQuery the number of resource units of the
mysql001tenant. In this example, the value ofUNIT_NUMis2, indicating that the tenant has two resource units in each zone.SELECT * FROM oceanbase.DBA_OB_UNITS WHERE tenant_id = 1006;A sample query result is as follows:
+---------+-----------+--------+------------------+---------------+----------------------------+----------------------------+-------+----------------+----------+---------------------+-----------------------+----------------+----------------+---------+---------+-------------+---------------+---------------------+---------------------+-------------+ | UNIT_ID | TENANT_ID | STATUS | RESOURCE_POOL_ID | UNIT_GROUP_ID | CREATE_TIME | MODIFY_TIME | ZONE | SVR_IP | SVR_PORT | MIGRATE_FROM_SVR_IP | MIGRATE_FROM_SVR_PORT | MANUAL_MIGRATE | UNIT_CONFIG_ID | MAX_CPU | MIN_CPU | MEMORY_SIZE | LOG_DISK_SIZE | MAX_IOPS | MIN_IOPS | IOPS_WEIGHT | +---------+-----------+--------+------------------+---------------+----------------------------+----------------------------+-------+----------------+----------+---------------------+-----------------------+----------------+----------------+---------+---------+-------------+---------------+---------------------+---------------------+-------------+ | 1016 | 1006 | ACTIVE | 1003 | 1006 | 2023-09-25 17:06:38.569419 | 2023-09-25 17:06:51.030929 | zone1 | xxx.xx.xxx.194 | 2882 | NULL | NULL | NULL | 1002 | 1 | 1 | 5368709120 | 16106127360 | 9223372036854775807 | 9223372036854775807 | 1 | | 1017 | 1006 | ACTIVE | 1003 | 1007 | 2023-09-25 17:06:38.571540 | 2023-09-25 17:06:51.030929 | zone1 | xxx.xx.xxx.198 | 2882 | NULL | NULL | NULL | 1002 | 1 | 1 | 5368709120 | 16106127360 | 9223372036854775807 | 9223372036854775807 | 1 | | 1018 | 1006 | ACTIVE | 1003 | 1006 | 2023-09-25 17:06:38.573614 | 2023-09-25 17:06:51.030929 | zone2 | xxx.xx.xxx.192 | 2882 | NULL | NULL | NULL | 1002 | 1 | 1 | 5368709120 | 16106127360 | 9223372036854775807 | 9223372036854775807 | 1 | | 1019 | 1006 | ACTIVE | 1003 | 1007 | 2023-09-25 17:06:38.575723 | 2023-09-25 17:06:51.030929 | zone2 | xxx.xx.xxx.196 | 2882 | NULL | NULL | NULL | 1002 | 1 | 1 | 5368709120 | 16106127360 | 9223372036854775807 | 9223372036854775807 | 1 | | 1020 | 1006 | ACTIVE | 1003 | 1006 | 2023-09-25 17:06:38.579946 | 2023-09-25 17:06:51.031986 | zone3 | xxx.xx.xxx.204 | 2882 | NULL | NULL | NULL | 1002 | 1 | 1 | 5368709120 | 16106127360 | 9223372036854775807 | 9223372036854775807 | 1 | | 1021 | 1006 | ACTIVE | 1003 | 1007 | 2023-09-25 17:06:38.581002 | 2023-09-25 17:06:51.031986 | zone3 | xxx.xx.xxx.197 | 2882 | NULL | NULL | NULL | 1002 | 1 | 1 | 5368709120 | 16106127360 | 9223372036854775807 | 9223372036854775807 | 1 | +---------+-----------+--------+------------------+---------------+----------------------------+----------------------------+-------+----------------+----------+---------------------+-----------------------+----------------+----------------+---------+---------+-------------+---------------+---------------------+---------------------+-------------+ 6 rows in setModify the
PRIMARY_ZONEattribute of themysql001tenant to change the number of zones with top priority from 2 to 1.ALTER TENANT mysql001 PRIMARY_ZONE='zone1;zone2,zone3';View the execution status of the task for reducing primary zones.
SELECT * FROM oceanbase.DBA_OB_TENANT_JOBS WHERE JOB_TYPE='ALTER_TENANT_PRIMARY_ZONE' AND tenant_id = 1006;A sample query result is as follows:
+--------+---------------------------+------------+-------------+----------+----------------------------+----------------------------+-----------+--------------------------------------------------------+-------------------+----------------+-------------+ | JOB_ID | JOB_TYPE | JOB_STATUS | RESULT_CODE | PROGRESS | START_TIME | MODIFY_TIME | TENANT_ID | SQL_TEXT | EXTRA_INFO | RS_SVR_IP | RS_SVR_PORT | +--------+---------------------------+------------+-------------+----------+----------------------------+----------------------------+-----------+--------------------------------------------------------+-------------------+----------------+-------------+ | 4 | ALTER_TENANT_PRIMARY_ZONE | SUCCESS | 0 | 100 | 2023-09-25 17:26:00.069089 | 2023-09-25 17:26:20.919021 | 1006 | ALTER TENANT mysql001 PRIMARY_ZONE='zone1,zone2;zone3' | zone1;zone2;zone3 | xxx.xx.xxx.196 | 2882 | | 5 | ALTER_TENANT_PRIMARY_ZONE | SUCCESS | 0 | 100 | 2023-09-25 17:41:44.412459 | 2023-09-25 17:41:54.965873 | 1006 | ALTER TENANT mysql001 PRIMARY_ZONE='zone1;zone2,zone3' | zone1,zone2;zone3 | xxx.xx.xxx.196 | 2882 | +--------+---------------------------+------------+-------------+----------+----------------------------+----------------------------+-----------+--------------------------------------------------------+-------------------+----------------+-------------+ 2 rows in setIn the query result, find the corresponding task record based on the following fields:
START_TIME: the time when the task was initiated.SQL_TEXT: the SQL statement corresponding to the task.EXTRA_INFO: the primary zone information before or after the modification.
If the value of
JOB_STATUSisSUCCESSin the corresponding task record, the task for reducing primary zones is successfully executed.For more information about the fields in the
DBA_OB_TENANT_JOBSview, see DBA_OB_TENANT_JOBS.Query the basic information of the
mysql001tenant and confirm that the value of thePRIMARY_ZONEattribute is changed fromzone1,zone2tozone1.SELECT * FROM oceanbase.DBA_OB_TENANTS WHERE tenant_id = 1006;A sample query result is as follows:
+-----------+-------------+-------------+----------------------------+----------------------------+-------------------+---------------------------------------------+-------------------+--------------------+--------+---------------+--------+-------------+-------------------+------------------+---------------------+---------------------+---------------------+---------------------+--------------+----------------------------+----------+------------+-----------+ | TENANT_ID | TENANT_NAME | TENANT_TYPE | CREATE_TIME | MODIFY_TIME | PRIMARY_ZONE | LOCALITY | PREVIOUS_LOCALITY | COMPATIBILITY_MODE | STATUS | IN_RECYCLEBIN | LOCKED | TENANT_ROLE | SWITCHOVER_STATUS | SWITCHOVER_EPOCH | SYNC_SCN | REPLAYABLE_SCN | READABLE_SCN | RECOVERY_UNTIL_SCN | LOG_MODE | ARBITRATION_SERVICE_STATUS | UNIT_NUM | COMPATIBLE | MAX_LS_ID | +-----------+-------------+-------------+----------------------------+----------------------------+-------------------+---------------------------------------------+-------------------+--------------------+--------+---------------+--------+-------------+-------------------+------------------+---------------------+---------------------+---------------------+---------------------+--------------+----------------------------+----------+------------+-----------+ | 1006 | mysql001 | USER | 2023-09-25 17:06:51.025654 | 2023-09-25 17:41:44.412137 | zone1;zone2,zone3 | FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3 | NULL | MYSQL | NORMAL | NO | NO | PRIMARY | NORMAL | 0 | 1695634988660461888 | 1695634988660461888 | 1695634988660461888 | 4611686018427387903 | NOARCHIVELOG | DISABLED | 2 | 4.2.1.0 | 1004 | +-----------+-------------+-------------+----------------------------+----------------------------+-------------------+---------------------------------------------+-------------------+--------------------+--------+---------------+--------+-------------+-------------------+------------------+---------------------+---------------------+---------------------+---------------------+--------------+----------------------------+----------+------------+-----------+ 1 row in setQuery information about the resource units of the
mysql001tenant again. The value ofUNIT_NUMremains unchanged before and after the modification.SELECT * FROM oceanbase.DBA_OB_UNITS WHERE tenant_id = 1006;A sample query result is as follows:
+---------+-----------+--------+------------------+---------------+----------------------------+----------------------------+-------+----------------+----------+---------------------+-----------------------+----------------+----------------+---------+---------+-------------+---------------+---------------------+---------------------+-------------+ | UNIT_ID | TENANT_ID | STATUS | RESOURCE_POOL_ID | UNIT_GROUP_ID | CREATE_TIME | MODIFY_TIME | ZONE | SVR_IP | SVR_PORT | MIGRATE_FROM_SVR_IP | MIGRATE_FROM_SVR_PORT | MANUAL_MIGRATE | UNIT_CONFIG_ID | MAX_CPU | MIN_CPU | MEMORY_SIZE | LOG_DISK_SIZE | MAX_IOPS | MIN_IOPS | IOPS_WEIGHT | +---------+-----------+--------+------------------+---------------+----------------------------+----------------------------+-------+----------------+----------+---------------------+-----------------------+----------------+----------------+---------+---------+-------------+---------------+---------------------+---------------------+-------------+ | 1016 | 1006 | ACTIVE | 1003 | 1006 | 2023-09-25 17:06:38.569419 | 2023-09-25 17:06:51.030929 | zone1 | xxx.xx.xxx.194 | 2882 | NULL | NULL | NULL | 1002 | 1 | 1 | 5368709120 | 16106127360 | 9223372036854775807 | 9223372036854775807 | 1 | | 1017 | 1006 | ACTIVE | 1003 | 1007 | 2023-09-25 17:06:38.571540 | 2023-09-25 17:06:51.030929 | zone1 | xxx.xx.xxx.198 | 2882 | NULL | NULL | NULL | 1002 | 1 | 1 | 5368709120 | 16106127360 | 9223372036854775807 | 9223372036854775807 | 1 | | 1018 | 1006 | ACTIVE | 1003 | 1006 | 2023-09-25 17:06:38.573614 | 2023-09-25 17:06:51.030929 | zone2 | xxx.xx.xxx.192 | 2882 | NULL | NULL | NULL | 1002 | 1 | 1 | 5368709120 | 16106127360 | 9223372036854775807 | 9223372036854775807 | 1 | | 1019 | 1006 | ACTIVE | 1003 | 1007 | 2023-09-25 17:06:38.575723 | 2023-09-25 17:06:51.030929 | zone2 | xxx.xx.xxx.196 | 2882 | NULL | NULL | NULL | 1002 | 1 | 1 | 5368709120 | 16106127360 | 9223372036854775807 | 9223372036854775807 | 1 | | 1020 | 1006 | ACTIVE | 1003 | 1006 | 2023-09-25 17:06:38.579946 | 2023-09-25 17:06:51.031986 | zone3 | xxx.xx.xxx.204 | 2882 | NULL | NULL | NULL | 1002 | 1 | 1 | 5368709120 | 16106127360 | 9223372036854775807 | 9223372036854775807 | 1 | | 1021 | 1006 | ACTIVE | 1003 | 1007 | 2023-09-25 17:06:38.581002 | 2023-09-25 17:06:51.031986 | zone3 | xxx.xx.xxx.197 | 2882 | NULL | NULL | NULL | 1002 | 1 | 1 | 5368709120 | 16106127360 | 9223372036854775807 | 9223372036854775807 | 1 | +---------+-----------+--------+------------------+---------------+----------------------------+----------------------------+-------+----------------+----------+---------------------+-----------------------+----------------+----------------+---------+---------+-------------+---------------+---------------------+---------------------+-------------+ 6 rows in set
In the preceding example, the number of primary zones is changed from 2 to 1 for the mysql001 tenant. The tenant has two resource units in each zone before the change. After the change, the tenant still has two resource units in each zone but the number of primary zones changes from 2 to 1.