1,主日志传输状态检查
select status,error,gap_status from v$archive_dest_status where status<>'INACTIVE';
STATUS ERROR GAP_STATUS
--------- ----------------------------------------------------------------- ------------------------
VALID
VALID RESOLVABLE GAP
VALID NO GAP
VALID LOCALLY UNRESOLVABLE GAP
SQL> select * from v$archive_dest_status where DEST_ID in (1,2,3,4);
DEST_ID DEST_NAME STATUS TYPE DATABASE_MODE RECOVERY_MODE PROTECTION_MODE DESTINATION STANDBY_LOGFILE_COUNT STANDBY_LOGFILE_ACTIVE ARCHIVED_THREAD# ARCHIVED_SEQ# APPLIED_THREAD# APPLIED_SEQ# ERROR SRL DB_UNIQUE_NAME SYNCHRONIZATION_STATUS SYN GAP_STATUS
---------- -------------------------
1 LOG_ARCHIVE_DEST_1 VALID LOCAL OPEN IDLE MAXIMUM PERFORMANCE +NEWDATA 0 0 1 222181 0 0 NO zmsft CHECK CONFIGURATION NO
2 LOG_ARCHIVE_DEST_2 VALID PHYSICAL MOUNTED-STANDBY MANAGED MAXIMUM PERFORMANCE zmsftdg02 0 0 1 197249 1 222171 NO zmsftdg02 CHECK CONFIGURATION NO NO GAP
3 LOG_ARCHIVE_DEST_3 VALID PHYSICAL MOUNTED-STANDBY MANAGED MAXIMUM PERFORMANCE zmsftdg 0 0 2 197274 2 197273 NO zmsftdg CHECK CONFIGURATION NO NO GAP
4 LOG_ARCHIVE_DEST_4 VALID PHYSICAL MOUNTED-STANDBY MANAGED MAXIMUM PERFORMANCE zmsftdg03 0 0 2 197274 2 196950 NO zmsftdg03 CHECK CONFIGURATION NO LOCALLY UNRESOLVABLE GAP
2,备库进程状态查询
1* select process,client_process,sequence#,status from v$managed_standby
SQL> /
PROCESS CLIENT_P SEQUENCE# STATUS
--------- -------- ---------- ------------
ARCH ARCH 0 CONNECTED
ARCH ARCH 0 CONNECTED
ARCH ARCH 0 CONNECTED
ARCH ARCH 0 CONNECTED
MRP0 N/A 221892 WAIT_FOR_GAP
RFS UNKNOWN 221980 RECEIVING
RFS UNKNOWN 221965 RECEIVING
RFS UNKNOWN 221975 RECEIVING
RFS UNKNOWN 221970 RECEIVING
RFS UNKNOWN 221981 RECEIVING
RFS UNKNOWN 221968 RECEIVING
PROCESS CLIENT_P SEQUENCE# STATUS
--------- -------- ---------- ------------
RFS UNKNOWN 221963 RECEIVING
RFS LGWR 222182 RECEIVING
RFS UNKNOWN 221964 RECEIVING
RFS UNKNOWN 221977 RECEIVING
RFS UNKNOWN 221979 RECEIVING
RFS UNKNOWN 221966 RECEIVING
RFS UNKNOWN 221973 RECEIVING
RFS UNKNOWN 221976 RECEIVING
RFS UNKNOWN 221962 RECEIVING
RFS UNKNOWN 221971 RECEIVING
RFS UNKNOWN 221969 RECEIVING
PROCESS CLIENT_P SEQUENCE# STATUS
--------- -------- ---------- ------------
RFS UNKNOWN 221972 RECEIVING
RFS UNKNOWN 221982 RECEIVING
RFS UNKNOWN 221974 RECEIVING
RFS UNKNOWN 0 IDLE
RFS UNKNOWN 0 IDLE
RFS UNKNOWN 0 IDLE
RFS ARCH 0 RECEIVING
RFS UNKNOWN 0 IDLE
RFS UNKNOWN 0 IDLE
RFS UNKNOWN 0 IDLE
RFS LGWR 197276 RECEIVING
PROCESS CLIENT_P SEQUENCE# STATUS
--------- -------- ---------- ------------
RFS UNKNOWN 197275 RECEIVING
RFS UNKNOWN 0 IDLE
RFS UNKNOWN 0 IDLE
RFS UNKNOWN 221967 RECEIVING
RFS UNKNOWN 0 IDLE
RFS UNKNOWN 0 IDLE
RFS UNKNOWN 0 IDLE
RFS UNKNOWN 0 RECEIVING
RFS UNKNOWN 0 RECEIVING
3,延迟查询
SQL> list
1* select * from v$dataguard_stats
SQL> /
NAME VALUE UNIT TIME_COMPUTED DATUM_TIME
-------------------------------------------------- -------------------- ------------------------------ -------------------- --------------------
transport lag +06 00:21:29 day(2) to second(0) interval 08/20/2022 14:34:30 08/20/2022 14:34:23
apply lag day(2) to second(0) interval 08/20/2022 14:34:30
apply finish time day(2) to second(3) interval 08/20/2022 14:34:30
estimated startup time 42 second 08/20/2022 14:34:30
SQL>
4,gap查询
SQL> select * from v$archive_gap;
THREAD# LOW_SEQUENCE# HIGH_SEQUENCE#
---------- ------------- --------------
1 221892 221977