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 { ...
随机推荐
- CSS中Position属性static、absolute、fixed、relative
在html中网页可以看成一个立体的空间,一个完整的页面是由很多个页面堆积形成的,如下图所示 CSS中Position属性有四个可选值,它们分别是:static.absolute.fixed.rel ...
- banner自用图床
放些常用的图做图床,也不在别的平台用.
- 1004 Counting Leaves ——PAT甲级真题
1004 Counting Leaves A family hierarchy is usually presented by a pedigree tree. Your job is to coun ...
- vue项目配置 `webpack-obfuscator` 进行代码加密混淆
背景 公司代码提供给第三方使用,为了不完全泄露源码,需要对给出的代码进行加密混淆,前端代码虽然无法做到完全加密混淆,但是通过使用 webpack-obfuscator 通过增加随机废代码段.字符编码转 ...
- 永远不要眼高手低,Vue完整实现一套简单的增删改查CURD操作
1: 永远不要眼高手低,看起来很简单,但是你从来没有去动手试一下,就不知道其中真正需要注意的许多细节, 2:完整code如下: 1 <!DOCTYPE html> 2 <html l ...
- 【python3】 解:import导包机制
模块和包 模块:我们定义的.py结尾的文件就是一个模块,模块中通常定义了类.方法.变量等一系列功能: 包:存放模块的文件夹,含有init.py文件,定义path属性. import语句的作用 impo ...
- 公钥基础设施PKI利用SRAM物理不可克隆函数PUF实现芯片标识唯一性
下面给出PKI利用SRAM PUF实现芯片标识唯一性的方法思路: PKI利用SRAM PUF实现芯片标识唯一性的方式 (1)使用PUF原因 物理上不可克隆函数利用硅制造的自然变化来产生每个芯片统计上唯 ...
- 如何在 Istio 中支持 Dubbo、Thrift、Redis 以及任何七层协议?
赵化冰,腾讯云高级工程师,Istio Member,ServiceMesher管理委员,Istio 项目贡献者, Aerika 项目创建者 ,热衷于开源.网络和云计算.目前主要从事服务网格的开源和研发 ...
- 零投资!零风险!手把手教你挖pi币
为什么说PI币属于区块链4.0代币呢?我们先从人类社会的生产力生产关系的递进来做一波有利的证明! 原始社会--封建王朝--君主立宪--资本主义--社会主义 原始社会:社会物质财富分配既有弱肉强食也有按 ...
- FreeBSD安装xorg + xfce 4
FreeBSD安装xorg,以及xfce 安装xorg 可选包 -xorg 完整xorg环境包 -xorg-minimal xorg最小化包 ports安装 cd /usr/ports/x11/xor ...