Oracle RAC 11g DG Broker配置和测试

Oracle RAC 11g DG Broker配置和测试

之前在《RHEL6.4 + Oracle 11g DG测试环境快速搭建参考》已经简单说过。
本篇在实验环境中实际配置
环境: RHEL 6.5 + Oracle 11.2.0.4 GI、DB + Primary RAC(2 nodes)+ Standby RAC(2 nodes)
该实验环境的搭建可参考:模拟生产搭建Standby RAC实验环境(11.2.0.4 DG)

配置并测试DG Broker步骤:

1.停止MRP

2.修改 Listener.ora 文件

3.修改参数文件

4.创建配置

5.启用配置

6.切换测试

1.停止MRP

在备库停止MRP:

alter database recover managed standby database cancel; 2.修改 Listener.ora 文件

在各个节点grid用户的监听文件中,

[grid@jyrac1 ~]$ cd $ORACLE_HOME/network/admin [grid@jyrac1 admin]$ vi listener.ora

分别增加以下内容:

--Primary Node1 SID_LIST_LISTENER=(SID_LIST=(SID_DESC=(SID_NAME=jyzhao1)(GLOBAL_DBNAME=jyzhao_dgmgrl)(ORACLE_HOME=/opt/app/oracle/product/11.2.0/dbhome_1))) --Primary Node2 SID_LIST_LISTENER=(SID_LIST=(SID_DESC=(SID_NAME=jyzhao2)(GLOBAL_DBNAME=jyzhao_dgmgrl)(ORACLE_HOME=/opt/app/oracle/product/11.2.0/dbhome_1))) --Standby Node1 SID_LIST_LISTENER=(SID_LIST=(SID_DESC=(SID_NAME=jyzhao1)(GLOBAL_DBNAME=mynas_dgmgrl)(ORACLE_HOME=/opt/app/oracle/product/11.2.0/dbhome_1))) --Standby Node2 SID_LIST_LISTENER=(SID_LIST=(SID_DESC=(SID_NAME=jyzhao2)(GLOBAL_DBNAME=mynas_dgmgrl)(ORACLE_HOME=/opt/app/oracle/product/11.2.0/dbhome_1)))

注:因为我这里的环境之前没有配置其他的静态监听,而且默认使用的监听名字是LISTENER,所以,只需要直接添加这一行配置即可。
添加完毕后分别在各节点重新启动监听:

--@all nodes lsnrctl stop lsnrctl start 3.修改参数文件

检查当前DG_BROKER_CONFIG_FILE和dg_broker_start配置:

--ON Primary: SYS@jyzhao1 >show parameter dg_broker NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ dg_broker_config_file1 string /opt/app/oracle/product/11.2.0 /dbhome_1/dbs/dr1jyzhao.dat dg_broker_config_file2 string /opt/app/oracle/product/11.2.0 /dbhome_1/dbs/dr2jyzhao.dat dg_broker_start boolean FALSE --ON Standby: SQL> show parameter dg_broker NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ dg_broker_config_file1 string /opt/app/oracle/product/11.2.0 /dbhome_1/dbs/dr1mynas.dat dg_broker_config_file2 string /opt/app/oracle/product/11.2.0 /dbhome_1/dbs/dr2mynas.dat dg_broker_start boolean FALSE

需要把DG Broker配置文件的默认路径修改到ASM磁盘上,并将dg_broker_start修改为TRUE,具体操作如下:

--ON Primary: ASMCMD> mkdir +fra1/jyzhao/DATAGUARDCONFIG mkdir +data1/jyzhao/DATAGUARDCONFIG SQL> ALTER SYSTEM SET DG_BROKER_CONFIG_FILE1='+fra1/jyzhao/DATAGUARDCONFIG/dgb_config1.ora' SCOPE=BOTH sid='*'; ALTER SYSTEM SET DG_BROKER_CONFIG_FILE2='+data1/jyzhao/DATAGUARDCONFIG/dgb_config2.ora' SCOPE=BOTH sid='*'; alter system set dg_broker_start=true scope=both sid='*'; show parameter dg_broker --ON Standby: ASMCMD> mkdir +fra/mynas/DATAGUARDCONFIG mkdir +data/mynas/DATAGUARDCONFIG SQL> ALTER SYSTEM SET DG_BROKER_CONFIG_FILE1='+fra/mynas/DATAGUARDCONFIG/dgb_config1.ora' SCOPE=BOTH sid='*'; ALTER SYSTEM SET DG_BROKER_CONFIG_FILE2='+data/mynas/DATAGUARDCONFIG/dgb_config2.ora' SCOPE=BOTH sid='*'; alter system set dg_broker_start=true scope=both sid='*'; show parameter dg_broker

此时,主备库的alert告警日志中都会有启动DG Broker的信息:

Sun Aug 13 16:45:27 2017 DMON started with pid=41, OS id=7432 Starting Data Guard Broker (DMON) Sun Aug 13 16:45:49 2017 INSV started with pid=54, OS id=7459 4.创建配置

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/3ac7fc7d8a424218eec78621a4ca1866.html