Oracle RAC 11g DG Broker配置和测试(2)

dgmgrl sys/oracle
在dgmgrl下创建配置:

CREATE CONFIGURATION 'jydb' AS PRIMARY DATABASE IS 'jyzhao' CONNECT IDENTIFIER IS 'jyzhao'; ADD DATABASE 'mynas' AS CONNECT IDENTIFIER IS 'mynas';

实际操作如下:

DGMGRL> CREATE CONFIGURATION 'jydb' AS PRIMARY DATABASE IS 'jyzhao' CONNECT IDENTIFIER IS 'jyzhao'; Configuration "jydb" created with primary database "jyzhao" DGMGRL> ADD DATABASE 'mynas' AS CONNECT IDENTIFIER IS 'mynas'; Database "mynas" added 5.启用配置

在dgmgrl下启用配置,查看配置:

enable configuration; show configuration; show database verbose jyzhao

实际操作如下:

DGMGRL> enable configuration; Enabled. DGMGRL> show configuration; Configuration - jydb Protection Mode: MaxPerformance Databases: jyzhao - Primary database mynas - Physical standby database Fast-Start Failover: DISABLED Configuration Status: SUCCESS DGMGRL> show database verbose jyzhao Database - jyzhao Role: PRIMARY Intended State: TRANSPORT-ON Instance(s): jyzhao1 jyzhao2 Properties: DGConnectIdentifier = 'jyzhao' ObserverConnectIdentifier = '' LogXptMode = 'ASYNC' DelayMins = '0' Binding = 'optional' MaxFailure = '0' MaxConnections = '1' ReopenSecs = '300' NetTimeout = '30' RedoCompression = 'DISABLE' LogShipping = 'ON' PreferredApplyInstance = '' ApplyInstanceTimeout = '0' ApplyParallel = 'AUTO' StandbyFileManagement = 'AUTO' ArchiveLagTarget = '0' LogArchiveMaxProcesses = '4' LogArchiveMinSucceedDest = '1' DbFileNameConvert = '+data/mynas, +data1/jyzhao' LogFileNameConvert = '+data/mynas, +data1/jyzhao, +fra/mynas, +fra1/jyzhao' FastStartFailoverTarget = '' InconsistentProperties = '(monitor)' InconsistentLogXptProps = '(monitor)' SendQEntries = '(monitor)' LogXptStatus = '(monitor)' RecvQEntries = '(monitor)' ApplyLagThreshold = '0' TransportLagThreshold = '0' TransportDisconnectedThreshold = '30' SidName(*) StaticConnectIdentifier(*) StandbyArchiveLocation(*) AlternateLocation(*) LogArchiveTrace(*) LogArchiveFormat(*) TopWaitEvents(*) (*) - Please check specific instance for the property value Database Status: SUCCESS DGMGRL>

附一些常用的命令汇总:

show configuration; show database jyzhao; show database mynas; show database verbose jyzhao; show database verbose mynas; show instance verbose jyzhao1 on database jyzhao; show instance verbose jyzhao2 on database jyzhao; show instance verbose jyzhao1 on database mynas; show instance verbose jyzhao2 on database mynas;

这些常用命令的输出结果大家可以在自己的实验环境测试一下,我这里就不赘述了。

6.切换测试

我们配置DG Broker主要就是为了方便切换,在配置正确的环境中,只需要一条命令就可以switchover成功。
在dgmgrl下切换测试:

--一条命令完成switchover主备切换: switchover to mynas; --一条命令完成switchover主备切回: switchover to jyzhao;

来看看实际DG Broker的强大功能,以主备切换为例:

[oracle@jyrac1 ~]$ dgmgrl sys/oracle DGMGRL for Linux: Version 11.2.0.4.0 - 64bit Production Copyright (c) 2000, 2009, Oracle. All rights reserved. Welcome to DGMGRL, type "help" for information. Connected. DGMGRL> switchover to mynas; Performing switchover NOW, please wait... Operation requires a connection to instance "jyzhao2" on database "mynas" Connecting to instance "jyzhao2"... Connected. New primary database "mynas" is opening... Operation requires startup of instance "jyzhao1" on database "jyzhao" Starting instance "jyzhao1"... ORACLE instance started. Database mounted. Database opened. Switchover succeeded, new primary is "mynas"

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

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