1.三种保护模式

  – Maximum protection

在Maximum protection下, 可以保证从库和主库数据完全一样,做到zero data loss.事务同时在主从两边提交完成,才算事务完成。如果从库宕机或者网络出现问题,主从库不能通讯,主库也立即宕机。在这种方式下,具有最高的保护等级。但是这种模式对主库性能影响很大,要求高速的网络连接。

  – Maximum availability

在Maximum availability模式下,如果和从库的连接正常,运行方式等同Maximum protection模式,事务也是主从库同时提交。如果从库和主库失去联系,则主库自动切换到Maximum performance模式下运行,保证主库具有最大的可用性。

  – Maximum performance

在Maximum performance,主库把归档的 archived log通过arch进程传递给从库,在这种方式下,主库运行性能最高,但是不能保证数据不丢失,且丢失的数据受redo log的大小影响。在redo log过大的情况下,可能一天都没有归档一个日志,可以通过手工切换日志的方式来减小数据的丢失。

2.模式切换(Maximum performance切换至Maximum availability)

  a.查看保护的模式

     DGbroker查看:

DGMGRL> show configuration  verbose;

Configuration - dgc

  Protection Mode: MaxPerformance
Databases:
atest1 - Primary database
atest2 - Physical standby database Properties:
FastStartFailoverThreshold = ''
OperationTimeout = ''
FastStartFailoverLagLimit = ''
CommunicationTimeout = ''
ObserverReconnect = ''
FastStartFailoverAutoReinstate = 'TRUE'
FastStartFailoverPmyShutdown = 'TRUE'
BystandersFollowRoleChange = 'ALL'
ObserverOverride = 'FALSE'
ExternalDestination1 = ''
ExternalDestination2 = ''
PrimaryLostWriteAction = 'CONTINUE' Fast-Start Failover: DISABLED Configuration Status:
SUCCESS

     sqlplus查看:

SQL> select database_role,protection_mode,protection_level from v$database;

DATABASE_ROLE     PROTECTION_MODE      PROTECTION_LEVEL
---------------- -------------------- --------------------
PRIMARY MAXIMUM PERFORMANCE MAXIMUM PERFORMANCE

  b.查看备库的日志传输模式(参数LogXptMode(sync:同步传输/async:异步传输))

DGMGRL> show database verbose 'atest2';

Database - atest2

  Role:            PHYSICAL STANDBY
Intended State: APPLY-ON
Transport Lag: seconds (computed second ago)
Apply Lag: seconds (computed second ago)
Apply Rate: 97.00 KByte/s
Real Time Query: ON
Instance(s):
atest Properties:
DGConnectIdentifier = 'atest2'
ObserverConnectIdentifier = ''
LogXptMode = 'sync'
DelayMins = ''
Binding = 'optional'
MaxFailure = ''
MaxConnections = ''
ReopenSecs = ''
NetTimeout = ''
RedoCompression = 'DISABLE'
LogShipping = 'ON'
PreferredApplyInstance = ''
ApplyInstanceTimeout = ''
ApplyParallel = 'AUTO'
StandbyFileManagement = 'AUTO'
ArchiveLagTarget = ''
LogArchiveMaxProcesses = ''
LogArchiveMinSucceedDest = ''
DbFileNameConvert = ''
LogFileNameConvert = ''
FastStartFailoverTarget = ''
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
ApplyLagThreshold = ''
TransportLagThreshold = ''
TransportDisconnectedThreshold = ''
SidName = 'atest'
StaticConnectIdentifier = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=vijay02.database.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=atest2_DGMGRL)(INSTANCE_NAME=atest)(SERVER=DEDICATED)))'
StandbyArchiveLocation = '/u01/app/oracle/oradata/ATEST/archivelog'
AlternateLocation = ''
LogArchiveTrace = ''
LogArchiveFormat = '%t_%s_%r.dbf'
TopWaitEvents = '(monitor)' Database Status:
SUCCESS

  c.如果LogXptMode的值为async,就要将其修改为sync

DGMGRL> edit database atest1 set property logxptmode=sync;
Property "logxptmode" updated

  d.修改完之后再次确认LogXptMode的值,如步骤b

  e.切换模式(如果切换失败,则再次去确认备库LogXptMode的值)

DGMGRL> edit configuration set protection mode as maxavailability;
Succeeded.

  f. 确认数据库的的保护模式,如步骤a

  g.需要注意的是,步骤c中修改的sync是备库的值,切记!

3.个人小结:

  a.三种模式在可以在DGbroker中自由切换(使用步骤2的方式)(在测试库中),正常情况下,数据库能迅速反应过来(查看保护模式的时候)。

  b.使用Maximum performance的时候,参数(备库)LogXptMode设置为async就好/

  c.使用Maximum protection或者Maximum availability的时候,参数(备库)LogXptMode要设置为sync。

  d.(经测试)使用Maximum protection时,当备库出现异常(如网络问题,数据库宕机),主库会挂起(告警日志会报如下错误),当备库恢复正常之后,主库也会恢复。

LGWR: Error  attaching to RFS for reconnect

  e.使用Maximum protection时,在当备库出现异常的情况下,当主库挂起时,(主库)可以强制切换到 Maximum performance,但当重新切回Maximum protection(在备库恢复时),主库需重启。

DGMGRL> edit configuration set protection mode as maxprotection;
Operation requires shutdown of instance "atest" on database "atest1"
Shutting down instance "atest"...
Unable to connect to database
ORA-: Connect failed because target host or object does not exist Failed.
Warning: You are no longer connected to ORACLE. Please complete the following steps to finish the operation:
shut down instance "atest" of database "atest1"
start up instance "atest" of database "atest1"

DGbroker三种保护模式的切换的更多相关文章

  1. 【Oracle】DG三种保护模式及切换方式

    一.三种保护方式 Required Redo Transport Attributes for Data Protection Modes Maximum Availability Maximum P ...

  2. 聊聊Dataguard的三种保护模式实验(上)

    Data Guard是Oracle高可用性HA的重要解决方案.针对不同的系统保护需求,DG提供了三种不同类型的保护模式(Protection Mode),分别为:最大保护(Maximum Protec ...

  3. DataGuard的三种保护模式

    (一)三种保护模式介绍1.最大性能模式这种模式保证数据库主库性能最大化,主备库之间数据是异步传输的.即,主备日志归档以后才会传输到备库,在备库上使用归档日志文件做恢复操作.这种模式提供在不影响prim ...

  4. Oracle Dataguard三种保护模式

    Oracle Dataguard提供了三种数据保护模式,在此分别总结一下三种数据保护模式的特点. 1.最大保护模式1)这种模式提供了最高级别的数据保护能力:2)要求至少一个物理备库收到重做日志后,主库 ...

  5. Data Guard 的三种保护模式

    官方文档链接 http://docs.oracle.com/cd/E11882_01/server.112/e41134/protection.htm#SBYDB02000 最大可用模式(Maximu ...

  6. 聊聊Dataguard的三种保护模式实验(下)

    4.最大保护模式Maximum Protection 最大保护模式是DG可以提供的最高保护级别,建立在日志同步传输和确认的基础上.同样,可以使用alter database方法进行设置. SQL> ...

  7. Dataguard三种保护模式

    Oracle Data Guard 提供三种高水平的数据保护模式来平衡成本.可用性.性能和事务保护.可以使用任意可用管理界面来轻松地设置这些模式.要确定适当的数据保护模式,企业需要根据用户对系统响应时 ...

  8. 探索Oracle11gR2 之 DataGuard 三种保护模式

    Oracle的DataGuard技术有三种实现模式,分别是max performance.max availability.maxprotection这三种模式. 以下是来自Oracle文档的摘要信息 ...

  9. Oracle Dataguard三种保护模式概述(转)

    Oracle的DataGuard技术有三种实现模式,分别是max performance.max availability.max protection这三种模式. 以下是来自Oracle文档的摘要信 ...

随机推荐

  1. 配置云服务器 FTP 服务

    自己配置的环境: OS: 阿里云 CentOS 6.5 >>Begin: 1. 登录到阿里云服务器(如何登录阿里云服务器), 在root权限下, 通过如下命令安装 vsftp [root@ ...

  2. Windows安装apache2.4

    The primary Windows platform for running Apache 2.4 is Windows 2000 or later. Always obtain and inst ...

  3. 强大的<canvas>

    <canvas> 个人认为<canvas>是h5最重量级的新标签了,现在各种h5小游戏都是基于<canvas>的,它为游戏提供了一个功能强大的画布,可在画布上绘制丰 ...

  4. ora-00119和ora-00132解决方案

    win7 64位    oracle 11g  先登录到sqlplus: sqlplus /nolog; 登录数据库: conn system/manager as sysdba; 然后启动数据库: ...

  5. arcgis server 下无法执行复杂的运算符

    1.Open the Administrator Directory and log in as a user with administrative permissions to the site. ...

  6. Android UI线程和非UI线程

    Android UI线程和非UI线程 UI线程及Android的单线程模型原则 当应用启动,系统会创建一个主线程(main thread). 这个主线程负责向UI组件分发事件(包括绘制事件),也是在这 ...

  7. Android 常用数据适配器ArrayAdapter

    接着上篇文章<Android 采用Layout Inflater创建一个View对象>,本文采用常用数据适配器ArrayAdapter 新建项目后,在layout文件夹下新建list_it ...

  8. Facebook开源动画库 POP-POPSpringAnimation运用

    POPSpringAnimation也许是大多数人使用POP的理由 其提供一个类似弹簧一般的动画效果:实例源代码已经上传至gitHub,地址:https://github.com/wujunyang/ ...

  9. iOS沙盒目录结构解析

    iOS沙盒目录结构解析 原文地址:http://blog.csdn.net/wzzvictory/article/details/18269713     出于安全考虑,iOS系统的沙盒机制规定每个应 ...

  10. 转载:设置html页面不让浏览器缓存的方法

    本文是转载文章,只是方便自己记录. 在html页面head标签之间添加以下标识可以避免大多数浏览器缓存: <meta http-equiv="Pragma" content= ...