The CDB_OB_LOG_RESTORE_SOURCE and DBA_OB_LOG_RESTORE_SOURCE views record log restore source information. You can query these views to obtain the log restore source information.
Procedure
Log in as the administrator to the standby tenant or the
systenant of the cluster where the standby tenant resides.Execute the following command to view the log restore source information.
View log restore source information in the
systenantSELECT * FROM oceanbase.CDB_OB_LOG_RESTORE_SOURCE;View log restore source information in a user tenant
MySQL-compatible mode
SELECT * FROM oceanbase.DBA_OB_LOG_RESTORE_SOURCE;Oracle-compatible mode
SELECT * FROM SYS.DBA_OB_LOG_RESTORE_SOURCE;
In a log archiving-based physical standby database, a sample query result for the standby tenant's log restore source is as follows:
+-----------+----+----------+--------------------------------+---------------------+ | TENANT_ID | ID | TYPE | VALUE | RECOVERY_UNTIL_SCN | +-----------+----+----------+--------------------------------+---------------------+ | 1006 | 1 | LOCATION | file:///data/1/sh_archive | 4611686018427387903 | +-----------+----+----------+--------------------------------+---------------------+ 1 row in setIn the query result, the value of the
TYPEcolumn isLOCATION, which indicates that the standby tenant synchronizes logs through log archiving from the primary tenant or source standby tenant.In a network-based physical standby database, a sample query result for the standby tenant's log restore source is as follows:
+-----------+----+---------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+ | TENANT_ID | ID | TYPE | VALUE | RECOVERY_UNTIL_SCN | +-----------+----+---------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+ | 1006 | 1 | SERVICE | IP_LIST=xx.xx.xx.22:17855;xx.xx.xx.23:17857;xx.xx.xx.24:17859,USER=rep_user@mysql,PASSWORD=***********************************,TENANT_ID=1004,CLUSTER_ID=1,COMPATIBILITY_MODE=MYSQL,IS_ENCRYPTED=true | 4611686018427387903 | +-----------+----+---------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+ 1 row in setIn the query result, the value of the
TYPEcolumn isSERVICE, which indicates that the standby tenant synchronizes logs by connecting to the primary tenant or source standby tenant over the network.Execute the following command to view the log link information.
View log link information in the
systenantSELECT * FROM oceanbase.GV$OB_LOG_TRANSPORT_DEST_STAT;View log link information in a user tenant
MySQL-compatible mode
SELECT * FROM oceanbase.GV$OB_LOG_TRANSPORT_DEST_STAT;Oracle-compatible mode
SELECT * FROM SYS.GV$OB_LOG_TRANSPORT_DEST_STAT;