编者按:
本文作者系大连健哥, POSTGRESQL、ORACLE 数据库资深从业人员、IT 技术的深度爱好者。相信科学改变人类、技术创造未来。个人主页:https://www.cnblogs.com/gaojian/,经其本人授权发布。
【免责声明】本号文章仅代表个人观点,与任何公司无关。
Data Guard Broker有一些属性,可以通过 show configuration 看到。
我有时会想,这些个属性,是否是分别属于primary 和 standby,如果
想要修改,是否需要分别登陆到primary 和 standby ,来分别修改呢?
这也是很多客户经常有的疑问。故此我进行了如下的实验。
先看看primary 端的 属性值:
代码语言:javascript复制-bash-4.1$ dgmgrl /
DGMGRL for Linux: Version 12.1.0.2.0 - 64bit Production
Copyright (c) 2000, 2013, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
Connected as SYSDG.
DGMGRL> show configuration verbose;
Configuration - DRSolution
Protection Mode: MaxPerformance
Members:
orcl12102 - Primary database
orcl12102_stby - Physical standby database
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'
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
DGMGRL>
再看Standby 端的属性:
代码语言:javascript复制-bash-4.1$ dgmgrl /
DGMGRL for Linux: Version 12.1.0.2.0 - 64bit Production
Copyright (c) 2000, 2013, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
Connected as SYSDG.
DGMGRL> show configuration verbose;
Configuration - DRSolution
Protection Mode: MaxPerformance
Members:
orcl12102 - Primary database
orcl12102_stby - Physical standby database
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'
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
DGMGRL>
从 primary 和 standby 两边看到的属性值都是一样的。所以我有一个猜测,这些属性值是共通的。
下面通过修改 CommunicationTimeout 的值来进行验证:
在primary 端修改:
代码语言:javascript复制DGMGRL> EDIT CONFIGURATION SET PROPERTY CommunicationTimeout=120;
Property "communicationtimeout" updated
改完后验证一下:
代码语言:javascript复制DGMGRL> show configuration verbose;
Configuration - DRSolution
Protection Mode: MaxPerformance
Members:
orcl12102 - Primary database
orcl12102_stby - Physical standby database
Properties:
FastStartFailoverThreshold = '30'
OperationTimeout = '30'
TraceLevel = 'USER'
FastStartFailoverLagLimit = '30'
CommunicationTimeout = '120' ******
ObserverReconnect = '0'
FastStartFailoverAutoReinstate = 'TRUE'
FastStartFailoverPmyShutdown = 'TRUE'
BystandersFollowRoleChange = 'ALL'
ObserverOverride = 'FALSE'
ExternalDestination1 = ''
ExternalDestination2 = ''
PrimaryLostWriteAction = 'CONTINUE'
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
DGMGRL>
那么,在 standby 端,会看到怎样的结果呢?
代码语言:javascript复制DGMGRL> show configuration verbose;
Configuration - DRSolution
Protection Mode: MaxPerformance
Members:
orcl12102 - Primary database
orcl12102_stby - Physical standby database
Properties:
FastStartFailoverThreshold = '30'
OperationTimeout = '30'
TraceLevel = 'USER'
FastStartFailoverLagLimit = '30'
CommunicationTimeout = '120' <<<<<<<<<<<<< 从 standby 端,也可以看到这个值,确实被改变了。
ObserverReconnect = '0'
FastStartFailoverAutoReinstate = 'TRUE'
FastStartFailoverPmyShutdown = 'TRUE'
BystandersFollowRoleChange = 'ALL'
ObserverOverride = 'FALSE'
ExternalDestination1 = ''
ExternalDestination2 = ''
PrimaryLostWriteAction = 'CONTINUE'
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
DGMGRL>
事实上,从 standby 端来更改其他的属性值,也是可以的,我们也可以从primary 端,连接到 data guard broker,看到同样的改变。
所以说,Data Guard Broker 搭建完毕后,如果想更改其属性值,无论是从primary 端,还是从standby 端,登陆连接到broker 后,在哪一端修改都是可以的。