This topic describes how to modify the attributes of a tenant.
Limitations
You can modify the attributes of a tenant only from the sys tenant.
Procedure
After a tenant is created, you can modify information about the tenant by using an SQL statement, including the number of replicas, zone list, primary zone, and system variables of the tenant.
Log on to the
systenant as therootuser.Execute the following statement to modify tenant attributes.
Sample statement:
ALTER TENANT {tenant_name | ALL} [SET] [tenant_option_list] [opt_global_sys_vars_set] tenant_option_list: tenant_option [, tenant_option ...] tenant_option: COMMENT [=]'string' |PRIMARY_ZONE [=] zone |RESOURCE_POOL_LIST [=](poolname [, poolname...]) |DEFAULT TABLEGROUP [=] {NULL | tablegroupname} |LOCALITY [=] 'locality description'; opt_global_sys_vars_set: VARIABLES system_var_name = expr [,system_var_name = expr] ...Notes:
ALLindicates to modify all tenants.PRIMARY_ZONEspecifies the primary zone of the tenant.RESOURCE_POOL_LISTspecifies the list of resource pools. You can add or delete only one resource pool at a time.You cannot directly replace the resource pool of the tenant. Assume that the resource pool used by the tenant is
pool1. The system returns an error if you execute the following statement to replace the resource pool withpool2:obclient> ALTER TENANT tenant1 resource_pool_list=('pool2'); ERROR 1210 (HY000): Incorrect arguments to resource pool listDEFAULT TABLEGROUPspecifies the default table group of the tenant. If this parameter is set toNULL, the default table group of the database is disabled.LOCALITYspecifies the distribution of replicas across zones. For example,F@z1,F@z2,F@z3,R@z4indicates thatz1,z2, andz3are full-featured replicas, andz4is a read-only replica.
Examples:
Change the primary zone of
tenant1tozone2.obclient> ALTER TENANT tenant1 primary_zone='zone2';Modify the locality of
tenant1to increase the number of replicas.Findicates a full-featured replica, andB_4is the name of the zone to be created.obclient> ALTER TENANT tenant1 locality="F@B_1,F@B_2,F@B_3,F@B_4"
More information
For more information about the ALTER TENANT statement, see ALTER TENANT.