All Products
Search
Document Center

ALTER TENANT

Last Updated: Jun 18, 2021

Description

You can execute the ALTER TENANT 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

The name of the tenant that you want to modify.

ALTER TENANT ALL

Modify information for all tenants at a time.

RESOURCE_POOL_LIST

The resource pools. This parameter is required when you create a tenant. You can specify only one resource pool.

DEFAULT TABLEGROUP

The default table group of the tenant. A NULL value specifies no default table group for the database.

LOCK|UNLOCK

Lock or unlock the tenant. After the tenant is locked, you cannot create sessions on the tenant. The existing sessions remain unchanged. You can lock a tenant if the subscription of the service is not renewed upon expiration. After the subscription is renewed, you can unlock the tenant.

COMMENT

The comments.

CHARACTER SET | CHARSET

The character set for the tenant.

COLLATE

The collation.

REPLICA_NUM

The number of replicas.

ZONE_LIST

The zones.

PRIMARY_ZONE

The primary zone.

READ ONLY | READ WRITE

The attribute of the tenant. Valid values: READ ONLY and READ WRITE.

LOGONLY_REPLICA_NUM

The number of log replicas.

LOCALITY

The distribution of replicas across zones. For example, the F@z1,F@z2,F@z3,R@z4 value specifies that replicas in the z1, z2, and z3 zones are FULL replicas, and replicas in the z4 zone are READONLY replicas.

system_var_name

The system variable for the tenant.

Examples

  • Lock the TENANT1 tenant.
ALTER TENANT TENANT1 LOCK;

Notes

The system tenants and administrator of the current tenant have the permission to execute the ALTER TENANT statement.