Purpose
The ALTER SYSTEM SET STANDBY TENANT statement is used to set the protection mode of the primary tenant.
Limitations and considerations
- For OceanBase Database V4.4.2, the protection mode can be set starting from V4.4.2 BP1.
- The protection mode can only be set on the primary tenant.
- For a primary tenant in maximum performance mode, if you want to set the protection mode to maximum availability or maximum protection, it requires that the primary tenant has a strongly synchronized standby tenant. The SQL statement to set a strongly synchronized standby tenant for the primary tenant is described in SET SYNC_STANDBY_DEST.For a tenant in maximum protection or maximum availability mode, you can directly change the protection mode to maximum performance mode.
- Cascading standby tenants cannot be set to strong synchronization mode.
- When setting the protection mode to maximum protection mode for a tenant in maximum performance or maximum availability mode, the synchronization point of the strongly synchronized standby tenant must not be more than 5 seconds behind the primary tenant's synchronization point.
Privilege requirements
This statement must be executed by the root user of the sys tenant (root@sys) or the administrator of each tenant. Specifically:
- In MySQL mode, the default administrator is the
rootuser. - In Oracle mode, the default administrator is the
SYSuser.
Syntax
ALTER SYSTEM SET STANDBY TENANT TO {MAXIMIZE PERFORMANCE} | {MAXIMIZE AVAILABILITY} | {MAXIMIZE PROTECTION} [TENANT = tenant_name];
Parameters
Parameter |
Description |
||
|---|---|---|---|
| {MAXIMIZE PERFORMANCE} | {MAXIMIZE AVAILABILITY} | {MAXIMIZE PROTECTION} | Specifies the protection mode as maximum performance mode (MAXIMIZE PERFORMANCE), maximum availability mode (MAXIMIZE AVAILABILITY), or maximum protection mode (MAXIMIZE PROTECTION). |
| tenant_name | The name of the tenant to execute the operation. #### Notice Only the system tenant needs to specify the tenant to operate on using the TENANT tenant_name clause. User tenants can only execute this command on themselves, so this clause is not required. |
Examples
- The system tenant sets the protection mode of the primary tenant named mysql to maximum availability mode.
obclient(root@sys)[(none)]> ALTER SYSTEM SET STANDBY TENANT TO MAXIMIZE AVAILABILITY TENANT = mysql;
- A user tenant sets the protection mode of its own tenant to maximum availability mode.
obclient> ALTER SYSTEM SET STANDBY TENANT TO MAXIMIZE AVAILABILITY;
