After you create a tenant, the sys tenant 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 use the CLI to rename a tenant by using the ALTER TENANT command, 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 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 of the
ALTER TENANTstatement:ALTER TENANT old_tenant_name RENAME GLOBAL_NAME TO new_tenant_name;Here is an example of changing 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.