IT-35Plus

每个人都是🏆
  新随笔  :: 管理

observer 和fsfo的关系

Posted on 2024-10-12 23:34  IT-35plus  阅读(11)  评论(0编辑  收藏  举报
结论1:主库和master ob 挂掉,不会fofo!
DGMGRL> SHOW OBSERVERS
ObserverConfigFile=observer.ora
observer configuration file parsing succeeded
Submitted command "SHOW OBSERVER" using connect identifier "orcl" 
Connected to "orcl"
Configuration - dg_config

  Primary:            orcl
  Active Target:      orcl2dg

Observer "grp_a" - Master

  Host Name:                    prdb19
  Last Ping to Primary:         0 seconds ago
  Last Ping to Target:          3 seconds ago

Observer "grp_b" - Backup

  Host Name:                    prdg19
  Last Ping to Primary:         2 seconds ago
  Last Ping to Target:          2 seconds ago

.
Submitted command "SHOW OBSERVER" using connect identifier "orcl2dg" 
Connected to "orcl2dg"

Configuration - dg_config

  Primary:            orcl
  Active Target:      orcl2dg

Observer "grp_a" - Master

  Host Name:                    prdb19
  Last Ping to Primary:         2 seconds ago
  Last Ping to Target:          2 seconds ago

Observer "grp_b" - Backup

  Host Name:                    prdg19
  Last Ping to Primary:         1 second ago
  Last Ping to Target:          1 second ago

.
Submitted command "SHOW OBSERVER" using connect identifier "orcl0dg" 
Connected to "orcl0dg"

Configuration - dg_config

  Primary:            orcl
  Active Target:      orcl2dg

Observer "grp_a" - Master

  Host Name:                    prdb19
  Last Ping to Primary:         2 seconds ago
  Last Ping to Target:          2 seconds ago

Observer "grp_b" - Backup

  Host Name:                    prdg19
  Last Ping to Primary:         1 second ago
  Last Ping to Target:          2 seconds ago




DGMGRL> SHOW CONFIGURATION  lag verbose

Configuration - dg_config

  Protection Mode: MaxPerformance
  Members:
  orcl    - Primary database
    orcl2dg - (*) Physical standby database 
              Transport Lag:      0 seconds (computed 0 seconds ago)
              Apply Lag:          0 seconds (computed 0 seconds ago)
    orcl0dg - Physical standby database 
              Transport Lag:      0 seconds (computed 0 seconds ago)
              Apply Lag:          0 seconds (computed 0 seconds ago)

  (*) Fast-Start Failover target

  Properties:
    FastStartFailoverThreshold      = '30'
    OperationTimeout                = '30'
    TraceLevel                      = 'USER'
    FastStartFailoverLagLimit       = '30'
    CommunicationTimeout            = '180'
    ObserverReconnect               = '0'
    FastStartFailoverAutoReinstate  = 'TRUE'
    FastStartFailoverPmyShutdown    = 'TRUE'
    BystandersFollowRoleChange      = 'ALL'
    ObserverOverride                = 'FALSE'
    ExternalDestination1            = ''
    ExternalDestination2            = ''
    PrimaryLostWriteAction          = 'CONTINUE'
    ConfigurationWideServiceName    = 'orcl_CFG'

Fast-Start Failover: Enabled in Potential Data Loss Mode
  Lag Limit:          30 seconds
  Threshold:          30 seconds
  Active Target:      orcl2dg
  Potential Targets:  "orcl2dg"
    orcl2dg    valid
  Observers:      (*) grp_a
                      grp_b
  Shutdown Primary:   TRUE
  Auto-reinstate:     TRUE
  Observer Reconnect: (none)
  Observer Override:  FALSE

Configuration Status:
SUCCESS

DGMGRL> 



经验分享:不要随意操作broker ,并发行不好,返回机制容易卡和行!尽量用视图获取数据!
--broker 数据无正常返回:
[root@prdg19 ~]# su - oracle
Last login: Sat Oct 12 22:10:17 CST 2024 on pts/2
[oracle@prdg19 rdbms]$ dgmgrl sys/Szcmb123_
DGMGRL for Linux: Release 19.0.0.0.0 - Production on Sat Oct 12 22:14:53 2024
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

Welcome to DGMGRL, type "help" for information.
Connected to "orcl2dg"
Connected as SYSDBA.
DGMGRL> SHOW CONFIGURATION  lag verbose



--Fast-Start Failover is not possible  因为没有master observer【结论,没有设置参数,不会切换】
Unable to connect to database using prdb19/orcl
[W000 2024-10-12T22:16:31.128+08:00] Primary database cannot be reached.
[W000 2024-10-12T22:16:31.128+08:00] Fast-Start Failover threshold has not exceeded. Retry for the next 1 second
[W000 2024-10-12T22:16:31.128+08:00] Try to connect to the primary.
[W000 2024-10-12T22:16:34.131+08:00] Primary database cannot be reached.
[W000 2024-10-12T22:16:34.131+08:00] Fast-Start Failover threshold has expired.
[W000 2024-10-12T22:16:34.131+08:00] Try to connect to the standby.
[W000 2024-10-12T22:16:34.131+08:00] Making a last connection attempt to primary database before proceeding with Fast-Start Failover.
[W000 2024-10-12T22:16:34.131+08:00] Check if the standby is ready for failover.
ORA-12543: TNS:destination host unreachable

Unable to connect to database using prdb19/orcl
[W000 2024-10-12T22:16:34.143+08:00] Fast-Start Failover is not possible because this observer is not the master.
[W000 2024-10-12T22:16:35.144+08:00] Try to connect to the primary.
ORA-12543: TNS:destination host unreachable

Unable to connect to database using prdb19/orcl
ORA-12543: TNS:destination host unreachable

Unable to connect to database using prdb19/orcl
[W000 2024-10-12T22:16:37.149+08:00] Primary database cannot be reached.
[W000 2024-10-12T22:16:37.149+08:00] Try to connect to the primary.
ORA-12543: TNS:destination host unreachable

Unable to connect to database using prdb19/orcl


--主库主机重启后,不会启动
DGMGRL>  SHOW CONFIGURATION  lag verbose
Configuration - dg_config
  Protection Mode: MaxPerformance
  Members:
  orcl    - Primary database
    Error: ORA-16810: multiple errors or warnings detected for the member
    orcl2dg - (*) Physical standby database 
      Error: ORA-16825: multiple errors or warnings, including fast-start failover-related errors or warnings, detected for the database
              Transport Lag:      8 minutes 43 seconds (computed 2 seconds ago)
              Apply Lag:          8 minutes 43 seconds (computed 2 seconds ago)

    orcl0dg - Physical standby database 
      Warning: ORA-16857: member disconnected from redo source for longer than specified threshold
              Transport Lag:      8 minutes 43 seconds (computed 2 seconds ago)
              Apply Lag:          8 minutes 43 seconds (computed 2 seconds ago)



--连接主库后,才能看到observer 的failover, 没有发现fsfo
DGMGRL>  show observer
Configuration - dg_config
  Primary:            orcl
  Active Target:      orcl2dg
Observer "grp_b" - Master
  Host Name:                    prdg19
  Last Ping to Primary:         0 seconds ago
  Last Ping to Target:          1 second ago
Observer "grp_a" - Backup
  Host Name:                    prdb19
  Last Ping to Primary:         (unknown)
  Last Ping to Target:          (unknown)




--解决方案[不可行]: 没有设置参数!测试结果同上,但是发现,主库启动后,ob failover,而且发生fsfo,风险较大! EDIT CONFIGURATION SET PROPERTY ObserverReconnect=5; EDIT CONFIGURATION SET PROPERTY ObserverOverride=TRUE; --同样的报错 Unable to connect to database using prdb19/orcl [W000 2024-10-12T22:51:57.905+08:00] Fast-Start Failover is not possible because this observer is not the master. [W000 2024-10-12T22:51:58.906+08:00] Try to connect to the primary. ORA-12543: TNS:destination host unreachable Unable to connect to database using prdb19/orcl ORA-12543: TNS:destination host unreachable Unable to connect to database using prdb19/orcl [W000 2024-10-12T22:52:00.917+08:00] Primary database cannot be reached. [W000 2024-10-12T22:52:00.917+08:00] Try to connect to the primary. ORA-12543: TNS:destination host unreachable Unable to connect to database using prdb19/orcl --下面程序没有成功 set serveroutput on declare status integer; begin status := dbms_dg.initiate_fs_failover('Failover Requested'); dbms_output.put_line('Fast-Start Failover is disabled: Expected status = ORA-16646'); dbms_output.put_line(' Actual Status = ORA-' || status); end; / exit;