DG:有多个备库如何切换
阅读原文时间:2023年07月08日阅读:1

问题描述:有一数据库准备进行主备switchover切换,但是有两个备库,其中最早一个备库状态已经出现GAP,第二个备库状态正常

SQL> show parameter log_archive_dest

NAME TYPE VALUE


log_archive_dest string
log_archive_dest_1 string LOCATION=+archdg VALID_FOR=(AL
L_LOGFILES,ALL_ROLES) DB_UNIQU
E_NAME=bjccora

NAME TYPE VALUE


log_archive_dest_2 string SERVICE=bjccoradg LGWR ASYNC C
OMPRESSION=ENABLE NOAFFIRM VAL
ID_FOR=(ONLINE_LOGFILES,PRIMAR
Y_ROLE) DB_UNIQUE_NAME=bjccora
dg

NAME TYPE VALUE


log_archive_dest_3 string service=bjccorastb lgwr async
valid_for=(online_logfiles,pri
mary_role) db_unique_name=bjcc
orastb

log_archive_dest_state_1 string ENABLE
log_archive_dest_state_10 string enable
log_archive_dest_state_11 string enable

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_state_12 string enable
log_archive_dest_state_13 string enable
log_archive_dest_state_14 string enable
log_archive_dest_state_15 string enable
log_archive_dest_state_16 string enable
log_archive_dest_state_17 string enable
log_archive_dest_state_18 string enable
log_archive_dest_state_19 string enable
log_archive_dest_state_2 string ENABLE
log_archive_dest_state_20 string enable
log_archive_dest_state_21 string enable

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_state_22 string enable
log_archive_dest_state_23 string enable
log_archive_dest_state_24 string enable
log_archive_dest_state_25 string enable
log_archive_dest_state_26 string enable
log_archive_dest_state_27 string enable
log_archive_dest_state_28 string enable
log_archive_dest_state_29 string enable
log_archive_dest_state_3 string enable
log_archive_dest_state_30 string enable
log_archive_dest_state_31 string enable

SELECT OPEN_MODE, DATABASE_ROLE, SWITCHOVER_STATUS, FORCE_LOGGING, DATAGUARD_BROKER, GUARD_STATUS FROM V$DATABASE;

alter system set log_archive_dest_state_2=defer scope=memory;

SQL> show parameter log_archive_dest_state_2

NAME TYPE VALUE


log_archive_dest_state_2 string defer
log_archive_dest_state_20 string enable
log_archive_dest_state_21 string enable
log_archive_dest_state_22 string enable
log_archive_dest_state_23 string enable
log_archive_dest_state_24 string enable
log_archive_dest_state_25 string enable
log_archive_dest_state_26 string enable
log_archive_dest_state_27 string enable
log_archive_dest_state_28 string enable
log_archive_dest_state_29 string enable

alter database commit to switchover to physical standby WITH SESSION SHUTDOWN;

手机扫一扫

移动阅读更方便

阿里云服务器
腾讯云服务器
七牛云服务器

你可能感兴趣的文章