Oracle-DG最大保护模式下,dg备库出现问题对主库有什么影响?
一、需求
疑问?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备库出现问题对主库有什么影响?的更多相关文章
- 验证DG最大性能模式下使用ARCH/LGWR及STANDBY LOG的不同情况
总结: --两台单实例数据库做DG,数据库版本号10.2.0.1.0 1.主库配置为:arch async,备库无STANDBY LOG. 日志中会有:RFS[4]: No standby redo ...
- ASM:《X86汇编语言-从实模式到保护模式》第17章:保护模式下中断和异常的处理与抢占式多任务
★PART1:中断和异常概述 1. 中断(Interrupt) 中断包括硬件中断和软中断.硬件中断是由外围设备发出的中断信号引发的,以请求处理器提供服务.当I/O接口发出中断请求的时候,会被像8259 ...
- 软件调试——IA-32 保护模式下寄存器一览
最近在看张银奎先生的<调试软件>一书,想将关键的技术记录下来,以便日后查阅,也分享给想看之人吧. 1 通用寄存器 EAX,EBX,ECX,EDX:用于运算的通用寄存器,可以使用AX,BX等 ...
- ASM:《X86汇编语言-从实模式到保护模式》第14章:保护模式下的特权保护和任务概述
★PART1:32位保护模式下任务的隔离和特权级保护 这一章是全书的重点之一,这一张必须要理解特权级(包括CPL,RPL和DPL的含义)是什么,调用门的使用,还有LDT和TSS的工作原理(15章着重 ...
- ASM:《X86汇编语言-从实模式到保护模式》第13章:保护模式下内核的加载,程序的动态加载和执行
★PART1:32位保护模式下内核简易模型 1. 内核的结构,功能和加载 每个内核的主引导程序都会有所不同,因为内核都会有不同的结构.有时候主引导程序的一些段和内核段是可以共用的(事实上加载完内核以后 ...
- 为什么在保护模式下IA-32处理器最高可访问4GB的内存
在保护模式下,IA-32处理器可访问最高达4GB的内存,这是32位无符号二进制整数地址能够寻址的上限. 今天看汇编的时候发现书里带过一句,不太明白为什么内存上限是4GB,就搜了一下,总结了一下答案. ...
- 保护模式下pmtest1.asm的理解
整个代码对应内存线性地址分为四段,[gdt] [code32] [video32] [code16] 代码先在实模式[code16]下运行,code16中的cs就是系统分配的该程序物理地址的基址. 编 ...
- IE保护模式下ActiveX控件打不开共享内存的解决方案
原文:http://www.cppblog.com/Streamlet/archive/2012/10/25/193831.html 感谢溪流漫话的投递 IE保护模式下,ActiveX控件会打不开别的 ...
- ActiveX IE保护模式下的低权限操作路径及Windows操作系统特殊路径
参考理解IE保护模式:https://blog.csdn.net/xt_xiaotian/article/details/5336809 文件帮助类: public class FileHelp { ...
随机推荐
- Jmeter的脚本参数化
一.变量 Jmeter中的变量用法:${变量名称} 变量定义:两种 1.用户定义变量 User Defined Variables 2.用户参数 User Parameters 1.1用户定义变量 ...
- How DRI and DRM Work
How DRI and DRM Work Introduction This page is intended as an introduction to what DRI and DRM are, ...
- 微信小程序去除页面滚动条
::-webkit-scrollbar { width: 0; height: 0; color: transparent; display: none; } 父级元素(滚动的元素) width:10 ...
- 虚拟机测试cobbler,网络安装加载最后出现 dracut:/#
1.cobbler的几个重要概念: distro:发行版系统容,我理解为镜像来源,提供了kernel 和 initrd 文件以及repo源 profile:kickstart文件,用于定制系统,定制安 ...
- HDOJ-1260(动态规划水题)
Tickets HDOJ-1260 #include<bits/stdc++.h> using namespace std; const int maxn=2003; int n; int ...
- Mybatis系列全解(四):全网最全!Mybatis配置文件XML全貌详解
封面:洛小汐 作者:潘潘 做大事和做小事的难度是一样的.两者都会消耗你的时间和精力,所以如果决心做事,就要做大事,要确保你的梦想值得追求,未来的收获可以配得上你的努力. 前言 上一篇文章 <My ...
- Linux速通08 网络原理及基础设置、软件包管理
使用 ifconfig命令来维护网络 # ifconfig 命令:显示所有正在启动的网卡的详细信息或设定系统中网卡的 IP地址 # 应用 ifconfig命令设定网卡的 IP地址: * 例:修改 et ...
- Hadoop hdfs副本存储和纠删码(Erasure Coding)存储优缺点
body { margin: 0 auto; font: 13px / 1 Helvetica, Arial, sans-serif; color: rgba(68, 68, 68, 1); padd ...
- SpringMVC-05 Json交互处理
SpringMVC-05 Json交互处理 Json 1.什么是JSON? JSON(JavaScript Object Notation, JS 对象标记) 是一种轻量级的数据交换格式,目前使用特别 ...
- tomcat启动错误Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/ofuns]];
起初遇到这个问题的时候是在实训(开发环境选择的是IDEA)的时候,检查了半天未果,上网搜索之后,说的也是各式各样,最后发现问题出在web.xml上面 在配置 filter 的 url-pattern ...