一、需求

疑问?Oracle最大保护模式下,dg备库出现问题,影响主库吗?

我们都知道Oracle最大保护模式的意思是oracle不允许数据丢失,1条记录都不行! 那么备库有问题? oracle主库还能读写吗?

二、测试

2.1 现有情况查询

--查询保护模式:最大保护
SQL> select name,dbid,database_role,protection_mode from v$database;
NAME DBID DATABASE_ROLE PROTECTION_MODE
--------- ---------- ---------------- --------------------
DINGDING 2042277967 PRIMARY MAXIMUM PROTECTION 最大保护 最大保护模式下日志传输途径:
-打开主库的告警日志:
[oracle@bj /]$ tail -f /picclife/app/oracle/diag/rdbms/bj/dingding/trace/alert_dingding.log
LGWR: Standby redo logfile selected to archive thread 1 sequence 22
LGWR: Standby redo logfile selected for thread 1 sequence 22 for destination LOG_ARCHIVE_DEST_2
LGWR: RFS destination opened for reconnect at host 'sh' =>LGWR归档线程通过主机sh传输远端
Tue Jan 09 22:54:42 2018 =>备库RFS进程接收 --DG保护模式使用最大保护:主库的日志通过LGWR进程通过TNSNAMES.ORA文件远程传输-备库端RFS进程接收,按照备库参数指定路径存储归档文件:

2.2 备库关闭监听

--正常情况下:主库操作不受影响:
SQL> insert into a select * from emp where rownum=1;
SQL> commit; 制造异常:备库:将监听关闭:
$lsnrctl stop
--主库dml
不受影响: ?????

2.3 备库关闭网络

备库停止网络服务:
root: service network stop

主库
异常状态一:主库的事物操作,无法结束:DML操作无法commit;
SQL> insert into a select * from emp where rownum=1;
1 row created.
SQL> commit; 异常状态二:新建会话无法连接用户
SQL> conn scott/tiger 异常状态三:查询告警日志: 10分钟后,由于最大保护模式下,主库发起多次重连,没有结果,数据库abort强制关闭 TNS-00513: Destination host unreachable
nt secondary err code: 113
nt OS err code: 0
-- 警告:所有的备用数据库的目的地都失败了
WARNING: All standby database destinations have failed
-- 警告:保护主节点需要关闭实例
WARNING: Instance shutdown required to protect primary
******************************************************
LGWR (ospid: 15287): terminating the instance due to error 16098
Tue Jan 09 23:24:17 2018
System state dump requested by (instance=1, osid=15287 (LGWR)), summary=[abnormal instance termination].

2.4 主库挂了,dg immediate

主库shutdown abort;
最大保护模式,主库挂了,备库不允许immediate方式关闭
备库
SYS >shutdown immediate;
ORA-01154: database busy. Open, close, mount, and dismount not allowed now
SYS >select status from v$instance;
STATUS
------------
OPEN
---主库挂了,备库无法immediate
>shutdown abort

2.5 dg无法连接,主库startup

---备库启动数据库
>startup --备库监听状态查询:关闭状态
[oracle@sh ~]$ lsnrctl status
TNS-12541: TNS:no listener --启动主库:
SQL> startup Error 12541 received logging on to the standby
Check whether the listener is up and running.
LGWR: Error 12541 creating archivelog file 'sh'
Crash Recovery Foreground: All standby destinations have failed
******************************************************
WARNING: All standby database destinations have failed
WARNING: Instance shutdown required to protect primary
******************************************************
USER (ospid: 16354): terminating the instance due to error 16098
System state dump requested by (instance=1, osid=16354), summary=[abnormal instance termination]. 特性:实验证明:如果之前建立了连接,主库与备库直接,监听程序断开不受影响【监听:提供新的会话连接】
---如果数据库关闭状态,备库监听关闭、网络无法连接,则主库无法open,最大保护模式

三、阅读官方文档

Maximum Protection

This protection mode ensures that no data loss will occur if the primary database fails. To provide this level of protection, 
the redo data needed to recover a transaction must be written to both the online redo log and to the standby redo log on at
least one synchronized standby database before the transaction commits. To ensure that data loss cannot occur,
the primary database will shut down, rather than continue processing transactions,
if it cannot write its redo stream to at least one synchronized standby database. Transactions on the primary are considered protected as soon as Data Guard has written the redo data to
persistent storage in a standby redo log file. Once that is done, acknowledgment is quickly made back to
the primary database so that it can proceed to the next transaction. This minimizes the impact of synchronous
transport on primary database throughput and response time. To fully benefit from complete Data Guard validation
at the standby database, be sure to operate in real-time apply mode so that redo changes are applied to the standby
database as fast as they are received. Data Guard signals any corruptions that are detected so that immediate corrective
action can be taken. Because this data protection mode prioritizes data protection over primary database availability, Oracle recommends that
a minimum of two standby databases be used to protect a primary database that runs in maximum protection mode to prevent
a single standby database failure from causing the primary database to shut down.
Note:
Asynchronously committed transactions are not protected by Data Guard against loss until the redo generated by those transactions
has been written to the standby redo log of at least one synchronized standby database.
最大保护模式下,主库的事务的日志 commit提交,除了需要本地 log buffer 数据 落盘写入online reodo logfile中之外;
还需要写入到dg online reodolog 已确保数据不丢失,随后dg最快速度反馈给主库,通知dg备库端日志写完成,主库commit 可以异步提交反馈了。
假设有2个最大保护模式的dg,坏一个没关系,主库的日志保障写入到任意一个的dg就可以进行反馈。
这个与最近听华为的gauss db 的备库也是一样的。

Oracle-DG最大保护模式下,dg备库出现问题对主库有什么影响?的更多相关文章

  1. 验证DG最大性能模式下使用ARCH/LGWR及STANDBY LOG的不同情况

    总结:  --两台单实例数据库做DG,数据库版本号10.2.0.1.0 1.主库配置为:arch async,备库无STANDBY LOG. 日志中会有:RFS[4]: No standby redo ...

  2. ASM:《X86汇编语言-从实模式到保护模式》第17章:保护模式下中断和异常的处理与抢占式多任务

    ★PART1:中断和异常概述 1. 中断(Interrupt) 中断包括硬件中断和软中断.硬件中断是由外围设备发出的中断信号引发的,以请求处理器提供服务.当I/O接口发出中断请求的时候,会被像8259 ...

  3. 软件调试——IA-32 保护模式下寄存器一览

    最近在看张银奎先生的<调试软件>一书,想将关键的技术记录下来,以便日后查阅,也分享给想看之人吧. 1 通用寄存器 EAX,EBX,ECX,EDX:用于运算的通用寄存器,可以使用AX,BX等 ...

  4. ASM:《X86汇编语言-从实模式到保护模式》第14章:保护模式下的特权保护和任务概述

    ★PART1:32位保护模式下任务的隔离和特权级保护  这一章是全书的重点之一,这一张必须要理解特权级(包括CPL,RPL和DPL的含义)是什么,调用门的使用,还有LDT和TSS的工作原理(15章着重 ...

  5. ASM:《X86汇编语言-从实模式到保护模式》第13章:保护模式下内核的加载,程序的动态加载和执行

    ★PART1:32位保护模式下内核简易模型 1. 内核的结构,功能和加载 每个内核的主引导程序都会有所不同,因为内核都会有不同的结构.有时候主引导程序的一些段和内核段是可以共用的(事实上加载完内核以后 ...

  6. 为什么在保护模式下IA-32处理器最高可访问4GB的内存

    在保护模式下,IA-32处理器可访问最高达4GB的内存,这是32位无符号二进制整数地址能够寻址的上限.  今天看汇编的时候发现书里带过一句,不太明白为什么内存上限是4GB,就搜了一下,总结了一下答案. ...

  7. 保护模式下pmtest1.asm的理解

    整个代码对应内存线性地址分为四段,[gdt] [code32] [video32] [code16] 代码先在实模式[code16]下运行,code16中的cs就是系统分配的该程序物理地址的基址. 编 ...

  8. IE保护模式下ActiveX控件打不开共享内存的解决方案

    原文:http://www.cppblog.com/Streamlet/archive/2012/10/25/193831.html 感谢溪流漫话的投递 IE保护模式下,ActiveX控件会打不开别的 ...

  9. ActiveX IE保护模式下的低权限操作路径及Windows操作系统特殊路径

    参考理解IE保护模式:https://blog.csdn.net/xt_xiaotian/article/details/5336809 文件帮助类: public class FileHelp { ...

随机推荐

  1. react性能提升

    1.把.bind(this)提升到constructor里面 2.在生命周期函数里面shouldComponentupdate里面做父组件改变重新渲染以致于子组件重新渲染的禁止 3.在setstate ...

  2. 图文详解:Kafka到底有哪些秘密让我对它情有独钟呢?

  3. Django Admin 删除文件同时删除资源文件(delete_upload_files)

    一  使用环境 开发系统: windows IDE: pycharm 数据库: msyql,navicat 编程语言: python3.7  (Windows x86-64 executable in ...

  4. MySQL注入与informantion_schema库

    目录 只可读 自动开启 和MySQL注入有关的3个表 手动注入的使用案例 表介绍 查询一个表中全部字段的过程 MySQL V5.0安装完成会默认会生成一个库(informantion_schema), ...

  5. three.js cannon.js物理引擎之齿轮动画

    郭先生今天继续说一说cannon.js物理引擎,并用之前已经学习过的知识实现一个小动画,知识点包括ConvexPolyhedron多边形.Shape几何体.Body刚体.HingeConstraint ...

  6. JAVA多线程与锁机制

    JAVA多线程与锁机制 1 关于Synchronized和lock synchronized是Java的关键字,当它用来修饰一个方法或者一个代码块的时候,能够保证在同一时刻最多只有一个线程执行该段代码 ...

  7. Apache配置 1. 默认虚拟主机

    编辑httpd.conf搜索httpd-vhosts,去掉#号 # vi /usr/local/apache2.4/conf/httpd.conf Include conf/extra/httpd-v ...

  8. 安装VMTools失败的三类解决方法(Windows、Linux、MacOs)

    前言 写这篇笔记的原因,是前几天在虚拟机 Vmware 中重新安装了几个操作系统,突然发现 VMTools 这个工具成了一个特殊的问题,以前还没有发现,因为通常它就给你自动安装了.但是大多数时候也是需 ...

  9. 灵魂拷问!浏览器输入「xxxxhub」的背后.....

    Hey guys 各位读者姥爷们大家好,这里是程序员 cxuan 计算机网络连载系列的第 13 篇文章. 到现在为止,我们算是把应用层.运输层.网络层和数据链路层都介绍完了,那么现在是时候把这些内容都 ...

  10. 计算机体系结构——CH2 指令系统

    CH2 指令系统 右键点击查看图像,查看清晰图像 X-mind CH2 指令系统 数据表示 定义 指计算机硬件能够直接识别,可以被指令系统直接调用的那些数据类型 确定哪些数据类型用哪些数据表示实现,是 ...