Purpose
You can use this statement to switch tenants.
Notice
- This statement must be executed in the sys tenant.
- This statement must be executed during direct connection with the OBServer node and be executed again after disconnection.
- This statement cannot be executed during transaction execution.
- After you switch to the sys tenant, you are granted only read and write permissions on the system tables.
Syntax
ALTER SYSTEM CHANGE TENANT tenant_name;
ALTER SYSTEM CHANGE TENANT TENANT_ID [=] tenant_id;
Parameters
| Parameter | Description |
|---|---|
| tenant_name | The name of the target tenant. |
| TENANT_ID [=] tenant_id | The ID of the target tenant. |
Examples
Switch to the tenant with the ID of 1001.
obclient> ALTER SYSTEM CHANGE TENANT TENANT_ID = 1001;