一、需求

疑问?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. Linux下安装mysql-5.7.28详细步骤

    一.下载Mysql 下载地址:https://downloads.mysql.com/archives/community/ 二.环境配置 检测系统是否自带Mysql # rmp -qa|grep m ...

  2. 高级FTP

      一.作业需求 1. 用户加密认证(已完成) 2. 多用户同时登陆(已完成) 3. 每个用户有自己的家目录且只能访问自己的家目录(已完成) 4. 对用户进行磁盘配额.不同用户配额可不同(已完成) 5 ...

  3. nacos集群

    本章分析一下nacos集群之间nacos服务器上线,下线原理 每5秒运行定时任务ServerListManager.ServerListUpdater获取新上线的节点或下线的节点 每2秒运行定时任务S ...

  4. 树莓派4b通过外接ssd硬盘启动系统失败的排查和解决

    树莓派4b通过外接ssd硬盘启动系统失败,症状: 屏幕卡在黑屏或提示 mmc1:Controller never released inhibit bit(s).... 先说如何设置硬盘启动,后面是解 ...

  5. [Elementary Mechanics Using Python-02]Feather in tornado

    Problem 9.17 Feather in tornado. In this project you will learn to use Newton's laws and the force m ...

  6. 【Arduino学习笔记04】消抖动的按键切换

    "开关抖动": 由于按键是基于弹簧-阻尼系统的机械部件,所以当按下一个按键时,读到的信号并不是从低到高,而是在高低电平之间跳动几毫秒之后才最终稳定. 代码解读: 1 const i ...

  7. Mongo的相关语法

    mongod的条件操作符 $gt -------- greater than > $gte --------- gt equal >= $lt -------- less than < ...

  8. springboot整合mybatis。mapper.xml资源文件放置到resources文件夹下的配置&别名使用配置

  9. elementUI实现日期框选中项文本高亮

    { margin: 0; font: 12px "Helvetica Neue" } p.p2 { margin: 0; font: 12px "PingFang SC& ...

  10. Linux less命令查看文件常用查询方法

    g 跳到文件开头 G 跳到文件结尾 / 往下搜索字符 ? 网上搜索字符 n 执行上一个搜索(/或者?的搜索),例如上一个搜索是使用/搜索的,则继续使用/搜索,即往下搜索结果 N 反向执行上一个搜索(/ ...