After you create a sys tenant, you can change the name of a regular tenant.
At present, OceanBase Database allows you to change only the name of a regular tenant.
Considerations
If you rename a tenant by using the command-line interface (ALTER TENANT) , the tenant becomes unavailable in OCP. If you need to manage the tenant in OCP, perform the renaming operation in OCP. For more information about how to rename a tenant in OCP, see Common questions about OceanBase tenants.
Procedure
Log in to the
systenant of the cluster as therootuser.Rename the regular tenant.
The following code shows the syntax for the
ALTER TENANTstatement:ALTER TENANT old_tenant_name RENAME GLOBAL_NAME TO new_tenant_name;For example, rename the tenant
tenant1totenant2:obclient> ALTER TENANT tenant1 RENAME GLOBAL_NAME TO tenant2;
References
For more information about the ALTER TENANT statement, see ALTER TENANT.