Purpose
You can use this statement to set the protection mode of the primary and standby clusters. You can execute this statement only in the primary cluster.
This statement can be executed only in the sys tenant.
OceanBase Database provides the following three protection modes:
Maximum performance
This is the default protection mode. It protects user data and maximizes the performance of the primary cluster. In this protection mode, a transaction can be committed immediately after the persistence of REDO logs in the primary cluster is complete. REDO logs are asynchronously transferred to standby clusters, without affecting the transaction commits in the primary cluster. Therefore, the performance of the primary cluster is not affected by the synchronization latency of standby clusters.
Maximum protection
This protection mode maximizes data protection to prevent data loss when the primary cluster fails. In this protection mode, a transaction can be committed only after the persistence of REDO logs in the primary cluster and the standby cluster that is in SYNC mode is complete.
In this protection mode, you can configure only one standby cluster in SYNC mode, and other standby clusters must be in ASYNC mode. If the standby cluster in SYNC mode is unavailable, the primary cluster stops the write service.
Maximum availability
This protection mode maximizes data protection without compromising cluster availability. By default, a transaction can be committed only after the persistence of REDO logs in the primary cluster and the standby cluster that is in SYNC mode is complete. However, when a failure of the standby cluster in SYNC mode is detected, the primary cluster no longer waits for the synchronization to complete. Instead, the services of the primary cluster are restored in the same way as that in maximum performance mode to ensure the availability of the cluster. After the services of the standby cluster in SYNC mode are restored, the primary cluster automatically resumes the SYNC mode to provide maximum data protection.
In this protection mode, you can configure only one standby cluster in SYNC mode, and other standby clusters must be in ASYNC mode.
For more information about how to configure and use the protection modes, see "Protection mode" in the OceanBase Database Administrator Guide.
Syntax
ALTER SYSTEM SET STANDBY CLUSTER TO MAXIMIZE
{AVAILABILITY | PERFORMANCE | PROTECTION};
Parameters
| Parameter | Description |
|---|---|
| AVAILABILITY | Sets to the maximum availability mode. |
| PERFORMANCE | Sets to the maximum performance mode, which is the default mode. |
| PROTECTION | Sets to the maximum protection mode. |
Examples
Set the protection mode of the primary and standby clusters to AVAILABILITY.
obclient> ALTER SYSTEM SET STANDBY CLUSTER TO MAXIMIZE AVAILABILITY;