This topic describes the protection mode and protection level of primary and standby tenants.
Mapping between protection mode and protection level
The protection mode feature defines how the primary tenant synchronizes logs to different standbys (strong synchronization versus asynchronous synchronization), how standbys receive those logs, and whether data can be lost.
The DBA_OB_TENANTS view in OceanBase Database provides two fields to describe the protection mode configuration and the status of primary and standby tenants: PROTECTION_MODE and PROTECTION_LEVEL.
Currently, the PROTECTION_MODE field can have the following values:
- MAXIMUM PERFORMANCE: maximum performance
- MAXIMUM PROTECTION: maximum protection
- MAXIMUM AVAILABILITY: maximum availability
The PROTECTION_LEVEL field can have the following values:
- MAXIMUM PERFORMANCE: maximum performance
- MAXIMUM PROTECTION: maximum protection
- MAXIMUM AVAILABILITY: maximum availability
- RESYNCHRONIZATION: resynchronization (catching up on logs)
Each tenant has its own protection mode and protection level. Only the standby tenants that are synchronized in strong sync mode have the same protection mode and protection level as the primary tenant. The protection mode and protection level of the standby tenants that are synchronized in async sync mode are always MAXIMUM PERFORMANCE.
The following table describes the mapping between protection modes and protection levels in the primary tenant and the meaning of each mapping.
Protection mode |
Protection level |
Description |
|---|---|---|
| MAXIMUM PERFORMANCE (maximum performance) | MAXIMUM PERFORMANCE (maximum performance) | The primary and standby tenants are synchronized in async sync mode. |
| MAXIMUM AVAILABILITY (maximum availability) | MAXIMUM AVAILABILITY (maximum availability) | Primary–standby synchronization is healthy. |
| RESYNCHRONIZATION (catching up on logs) | Primary–standby sync is unhealthy; the system has automatically fallen back to asynchronous synchronization. | |
| MAXIMUM PROTECTION (maximum protection) | MAXIMUM PROTECTION (maximum protection) | Primary–standby synchronization is healthy. |
| MAXIMUM PERFORMANCE (maximum performance) | Intermediate state during an upgrade. |
View the protection mode and protection level of a tenant
The following statements are used to view the protection mode and protection level of a primary or standby tenant:
View the protection mode and protection level of a specified tenant in the sys tenant.
obclient(root@sys)[oceanbase]> SELECT TENANT_NAME, PROTECTION_MODE, PROTECTION_LEVEL FROM oceanbase.DBA_OB_TENANTS WHERE TENANT_NAME = 'tenant_name';View the protection mode and protection level of a user tenant.
MySQL-compatible modeOracle-compatible modeIn MySQL-compatible mode, execute the following statement:
obclient(root@mysql001)[oceanbase]> SELECT TENANT_NAME, PROTECTION_MODE, PROTECTION_LEVEL FROM oceanbase.DBA_OB_TENANTS;In Oracle-compatible mode, execute the following statement:
obclient(sys@oracle001)[SYS]> SELECT TENANT_NAME, PROTECTION_MODE, PROTECTION_LEVEL FROM SYS.DBA_OB_TENANTS;
The following example shows the query result.
+-------------+---------------------+---------------------+
| TENANT_NAME | PROTECTION_MODE | PROTECTION_LEVEL |
+-------------+---------------------+---------------------+
| sys | NULL | NULL |
| META$1002 | NULL | NULL |
| mysql001 | MAXIMUM PERFORMANCE | MAXIMUM PERFORMANCE |
| META$1004 | NULL | NULL |
| oracle001 | MAXIMUM PERFORMANCE | MAXIMUM PERFORMANCE |
+-------------+---------------------+---------------------+
5 rows in set
