Description
You can use this statement to modify tenant information.
Syntax
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'
|{CHARACTER SET | CHARSET} [=] charsetname
|COLLATE [=] collationname
|REPLICA_NUM [=] num
|ZONE_LIST [=] (zone [, zone...])
|PRIMARY_ZONE [=] zone
|RESOURCE_POOL_LIST [=](poolname [, poolname...])
|DEFAULT TABLEGROUP [=] {NULL | tablegroupname}
|{READ ONLY | READ WRITE}
|LOGONLY_REPLICA_NUM [=] num
|LOCALITY [=] 'locality description'
|LOCK|UNLOCK;
opt_global_sys_vars_set:
VARIABLES system_var_name = expr [,system_var_name = expr] ...
Parameters
| Parameter | Description |
|---|---|
| tenant_name | Specifies the name of the tenant to be modified. |
| ALTER TENANT ALL | Modifies all tenants at the same time. |
| RESOURCE_POOL_LIST | Specifies a resource pool list, which is required when you create a tenant. Only one resource pool is supported. |
| DEFAULT TABLEGROUP | Specifies the default table group of the tenant. When you set it to NULL, the system disables the default table group. |
| LOCK|UNLOCK | Locks and unlocks tenants. New connections cannot be created on a locked tenant, but existing connections remain unchanged. This parameter is typically used in scenarios where a client fails to renew an expired subscription for a tenant. The system locks this tenant until the client renews the subscription. |
| COMMENT | Modifies the comment. |
| CHARACTER SET | CHARSET | Modifies the character set of a tenant. |
| COLLATE | Specifies collate rules. |
| REPLICA_NUM | Specifies the number of replicas. |
| ZONE_LIST | Specifies a list of zones to be modified. |
| PRIMARY_ZONE | Specifies the primary zone. |
| READ ONLY | READ WRITE | Specifies the read-only or read/write attribute of the tenant. |
| LOGONLY_REPLICA_NUM | Specifies the number of log replicas. |
| LOCALITY | Specifies the distribution of replicas across the zones. For example, F@z1, F@z2, F@z3, and R@z4 indicate that z1, z2, and Z3 are full-featured replicas, and z4 is a read-only replica. |
| system_var_name | Modifies the system variable value of the tenant. |
Example
- Lock tenant named tenant1.
ALTER TENANT TENANT1 LOCK;
Note
The ALTER TENANT statement can be executed by system tenants or by the administrator of the corresponding tenant.