Purpose
You can execute the FAILOVER statement to switch a standby tenant to be the primary tenant when the original primary tenant is unavailable.
After this statement is executed, all log stream data of the standby tenant is rolled back to the consistency checkpoint, and the standby tenant is switched to be the primary tenant.
Syntax
ALTER SYSTEM ACTIVATE STANDBY [TENANT tenant_name]
Note
- You must specify the
TENANT tenant_nameparameter when you execute this statement under the system tenant. - You can execute this statement only for the current user tenant.
Parameters
| Field | Description |
|---|---|
| STANDBY | Switches the standby tenant to be the primary tenant. |
| tenant_name | The name of the primary tenant. |
Examples
Execute the FAILOVER statement to switch a standby tenant tenant1 to be the primary tenant.
obclient> ALTER SYSTEM ACTIVATE STANDBY TENANT tenant1;
Query OK, 0 rows affected