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 appears 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 FAQ about OceanBase tenants.
Procedure
Log in to the
systenant of the cluster as therootuser.Rename the regular tenant.
The following code shows the syntax of the
ALTER TENANTstatement:ALTER TENANT old_tenant_name RENAME GLOBAL_NAME TO new_tenant_name;For example, change the name of the
tenant1tenant totenant2:obclient> ALTER TENANT tenant1 RENAME GLOBAL_NAME TO tenant2;
References
For more information about the ALTER TENANT statement, see ALTER TENANT.