解决ORA-16597: Data Guard broker detects two or more primaries.
今天用dg broker部署了一套1+3的dg。在做切换演练tyqxdg3-->iscdb1
的时候,出现报错:
在操作节点报错如下:
DGMGRL> SWITCHOVER TO iscdb1;
Performing switchover NOW, please wait...
Error: ORA-16597: Data Guard broker detects two or more primary databases
Error: ORA-16625: cannot reach database "iscdb1"
Failed.
Unable to switchover, primary database is still "iscdb1"
DGMGRL>
在tyqxdg3报错如下:
DGMGRL> show configuration;
Configuration - cfg_1
Protection Mode: MaxPerformance
Databases:
iscdb1 - Primary database
tyqxdg1 - Physical standby database
tyqxdg2 - Physical standby database
tyqxdg3 - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
ORA-16597: Data Guard broker detects two or more primary databases
ORA-16625: cannot reach database "iscdb1"
DGM-17017: unable to determine configuration status
在iscdb1的节点报错如下:
DGMGRL> show configuration;
配置 - cfg_1
保护模式: MaxPerformance
数据库:
tyqxdg3 - 主数据库
iscdb1 - 物理备用数据库
tyqxdg1 - 物理备用数据库
tyqxdg2 - 物理备用数据库
快速启动故障转移: DISABLED
配置状态:
ORA-16534: 正在执行切换, 故障转移或转换操作
DGM-17017: 无法确定配置状态
中间折腾了很久,最后检查了iscdb1的数据库的角色是primarydb
,tyqxdg3的角色是pysical_standby
这个说明了什么?
这个说明了切换其实是已经切换过去了,但是dg broker的相关信息有错误。
最后的解决办法是:
不去动在数据库上面dg的配置,将4套的dg_broker_start
设置为false
,然后删除broker的配置信息(broker_file指向的文件),再重新打开dg_broker_start=true
,再重新配置一次,就搞定了.
注意:
1.一开始使用了dgbroker配置dg,那么不管是在主库还是从库执行alter system set xxx=xxx scope=spfile;都不会记录到spfile里面。但可以用dgmrl 里面的edit 修改参数。
2.show configuration 出现错误的时候,可以执行show database verbose 'dbname' 查看错误。需要注意的是在
dgmgrl sys/oracle@pri
和dgmgrl sys/oracle@std
两端看到的错误是不同的- 3.如果看到
Warning: ORA-16714: the value of property StandbyFileManagement isinconsistent with the database setting
之类的错误,则修改edit database std set property StandbyFileManagement='auto'
;