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 timestamp, 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 in the sys tenant. - In a user tenant, you can execute this statement only for the current tenant.
Parameters
| Parameter | 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