After the log synchronization of a standby tenant starts, you can monitor the log synchronization status in real time by using the DBA_OB_TENANTS view, so that you can make timely adjustments.
View the synchronization progress of standby tenants from the sys tenant
You can log on to the sys tenant to view the synchronization progress of all tenants or a specified tenant.
Log on to the database as the administrator of the
systenant of the cluster where the specified standby tenant resides.Execute the following statement to view the synchronization progress of the specified standby tenant.
Sample statement:
SELECT TENANT_NAME, TENANT_ROLE, SWITCHOVER_STATUS, SCN_TO_TIMESTAMP(SYNC_SCN) FROM oceanbase.DBA_OB_TENANTS WHERE TENANT_NAME = 'oracle_standby'; +------------------+-------------+-------------------+---------------------------------+ | TENANT_NAME | TENANT_ROLE | SWITCHOVER_STATUS | SCN_TO_TIMESTAMP(SYNC_SCN) | +------------------+-------------+-------------------+---------------------------------+ | oracle_standby | STANDBY | NORMAL | 2023-03-08 14:39:36.089486 | +----------- --+-------------+-------------------+---------------------------------+ 1 row in setThe
SCN_TO_TIMESTAMP(SYNC_SCN)field in the query result displays the synchronization progress of the specified standby tenant. You can compare the displayed time with the current time. A large difference indicates that the synchronization progress of the standby tenant lags behind that of the primary tenant.For more information about the
DBA_OB_TENANTSview, see oceanbase.DBA_OB_TENANTS (MySQL Mode) or DBA_OB_TENANTS (Oracle Mode).
View the synchronization progress of a standby tenant from the current tenant
You can log on to a standby tenant to view the synchronization progress of the current tenant.
Log on to the database as the administrator of the standby tenant.
Execute the following statement to view the synchronization progress of the current tenant.
Sample statement:
MySQL mode
SELECT TENANT_NAME, TENANT_ROLE, SWITCHOVER_STATUS, SCN_TO_TIMESTAMP(SYNC_SCN) FROM oceanbase.DBA_OB_TENANTS; +------------------+-------------+-------------------+---------------------------------+ | TENANT_NAME | TENANT_ROLE | SWITCHOVER_STATUS | SCN_TO_TIMESTAMP(SYNC_SCN) | +------------------+-------------+-------------------+---------------------------------+ | mysql_standby | STANDBY | NORMAL | 2023-03-10 15:35:36.089486 | +------------------+-------------+-------------------+---------------------------------+ 1 row in setOracle mode
SELECT TENANT_NAME, TENANT_ROLE, SWITCHOVER_STATUS, SCN_TO_TIMESTAMP(SYNC_SCN) FROM DBA_OB_TENANTS; +------------------+-------------+-------------------+---------------------------------+ | TENANT_NAME | TENANT_ROLE | SWITCHOVER_STATUS | SCN_TO_TIMESTAMP(SYNC_SCN) | +------------------+-------------+-------------------+---------------------------------+ | oracle_standby | STANDBY | NORMAL | 08-MAR-23 14:39:36.089486 | +------------------+-------------+-------------------+---------------------------------+ 1 row in set
The
SCN_TO_TIMESTAMP(SYNC_SCN)field in the query result displays the synchronization progress of the standby tenant. You can compare the displayed time with the current time. A large difference indicates that the synchronization progress of the standby tenant lags behind that of the primary tenant.For more information about the
DBA_OB_TENANTSview, see oceanbase.DBA_OB_TENANTS (MySQL Mode) or DBA_OB_TENANTS (Oracle Mode).
More information
Adjust the log synchronization performance of a standby tenant