The sys tenant can rename a user tenant.
Currently, OceanBase AI Database supports renaming only user tenants.
Considerations
Renaming a tenant by using the command-line method (the ALTER TENANT statement) causes the tenant to appear unavailable in OCP. If you need to manage the tenant by using OCP, perform the renaming operation directly in OCP.
Procedure
Log in to the
systenant of the cluster as therootuser.Rename a user tenant.
The statement is as follows:
ALTER TENANT old_tenant_name RENAME GLOBAL_NAME TO new_tenant_name;For example, to change the tenant name from
tenant1totenant2:obclient> ALTER TENANT tenant1 RENAME GLOBAL_NAME TO tenant2;
References
For more information about the ALTER TENANT statement, see ALTER TENANT.