【DataGuard】Oracle DataGuard 最高可用模式 故障实验

Oracle DataGuard 最高可用模式 故障实验

文章摘要:通过实验模拟DataGuard 在最高可用模式下,模拟故障导致主库不能向物理备库(Physical Standby )传输日志时,主备库情况

Data Guard 提供三种数据保护模式:最大保护(Maximum Protection),最大可用(Maximum Availability)和 最大性能(Maximum Performance)。
最高可用模式(Maximum Availability)能提供非常高级别的数据保护。在这种模式下,只有当所有的redo日志备写入至少一个standby database时,事物才能提交。
当主库不能将redo日志写入至少一个standby database时,那么DG就相当于在最大性能(maximum performance)模式工作。



【Oracle11g官方文档中关于Dataguard 最高可用模式的介绍】

This protection mode provides the highest level of data protection that is possible without compromising the availability of a primary database. Transactions do not commit until all redo data needed to recover those transactions has been written to the online redo log and to the standby redo log on at least one synchronized standby database. If the primary database cannot write its redo stream to at least one synchronized standby database, it operates as if it were in maximum performance mode to preserve primary database availability until it is again able to write its redo stream to a synchronized standby database.

This mode ensures that no data loss will occur if the primary database fails, but only if a second fault does not prevent a complete set of redo data from being sent from the primary database to at least one standby database.




【实验环境】

操作系统:Red Hat Enterprise Linux Server release 5.4
数据库:Oracle Database 11g Enterprise Edition Release 11.2.0.3.0

【主库、物理备库结构信息】




【实验过程】

主库 Primary database绿色
物理备库 Physical standby database:黄色

1、查询主、备库角色和状态




2、模拟故障,主库停止向远程传归档

alter system set log_archive_dest_state_2=defer;

show parameter log_archive_dest_stat_2

 

 
3、查看状态和当前保护级别

主库查看发现,protection_mode仍然是最高可用模式,但当前protection_level显示resynchronization
即保护模式的目标没变,当前状态变了,需要同步。
此时相当于 【最大性能模式】
select database_role,protection_mode,protection_level from v$database;


 

4、主库创建测试表,插入数据并提交

 


5、主、备库查看日志,备库一直在等待


 




6、主库开启远程归档

主库开启远程归档,查看保护模式,protection_level已经变成 maximum availability 最高可用模式

alter system set log_archive_dest_stat_2=enable; 
select database_role,protection_mode,protection_level from v$database;





7、查看跟踪日志、测试表

主库已经开始将日志传向备库,    FAL 挖 日志代沟





备库查看测试表,已经可以查到


【实验总结】

通过上述实验模拟Oracle DataGuard在最高可用模式时,障导致主库不能向至少一个物理备库传送日志时,可以看到主库当前保护模式显示需要同步,此时主库可以正常进行读写操作。备库暂时无法接收到主库日志,此时DG相当于工作在最高性能模式。
当故障恢复,主库可以重新向备库传输日志后,保护模式重新恢复为最高可用模式,备库可以通过FAL发现日志代沟(GAP)并同主库同步。



吕星昊
2014.8.24

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29475508/viewspace-1256939/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/29475508/viewspace-1256939/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值