【DataGuard】DG系列之逻辑备库非实时更新小问题处理


一、概述

    DataGuard越来越成为数据库中灾备和分担压力的重要工具,作为传说中的DBA来说,你要下得了厨房、上得了厅堂。扯远了,看看这个小问题吧,弱爆了。

二、处理过程:

    这里所说非实时,并不是人为延迟数据传输、更新,主要问题在于当主库更新表数据后备库无法及时更新过来,在主库手动归档后数据才传输过来。也就是当主库操作后备库备库并没有接收该事务(日志),主库切换归档后备库读取归档日志数据才提取完成。下图为DG传输流程

查看主库、备库相关参数配置,并无异常,也曾参照该dg配置搭建了一套测试的dg环境,而该测试环境数据则是实时更新的。在查看dg配置文档时,发现测试环境启动日志应用语句中多一个immediate; 此前并无查看官方及相关文档,只是认为多一个它是立即启动日志应用。通过查看官方文档,得知,immediate的意思是立即应用日志。说明如下:

To start SQL Apply, start the logical standby database and issue the following statement:

SQL>  ALTER DATABASE START LOGICAL STANDBY APPLY;

To start real-time apply on the logical standby database to immediately apply redo data from the standby redo log files on the logical standby database, include the IMMEDIATE keyword as shown in the following statement:

SQL>  ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE;

 
If the real-time apply feature is enabled, log apply services can apply redo data as it is received, without waiting for the current standby redo log file to be archived. This results in faster switchover and failover times because the standby redo log files have been applied already to the standby database by the time the failover or switchover begins.

Use the ALTER DATABASE statement to enable the real-time apply feature, as follows:

· For physical standby databases, issue the ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE statement.

· For logical standby databases, issue the ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE statement.

Standby redo log files are required to use real-time apply

停止日志应用,再次启动(当然这次加了IMMEDIATE),查看表数据,当然数据为实时更新。

三、总结

这个其实没啥可总结的,基础知识不牢固,还没认真查看相关文档,不多说了。

在CentOS 6.4下安装Oracle 11gR2(x64)

Oracle 11gR2 在VMWare虚拟机中安装步骤

Debian 下 安装 Oracle 11g XE R2

Oracle Data Guard 重要配置参数

基于同一主机配置 Oracle 11g Data Guard

探索Oracle之11g DataGuard

Oracle Data Guard (RAC+DG) 归档删除策略及脚本

Oracle Data Guard 的角色转换

Oracle Data Guard的日志FAL gap问题

Oracle 11g Data Guard Error 16143 Heartbeat failed to connect to standby 处理方法

相关内容