热门标签 | HotTags
当前位置:  开发笔记 > 数据库 > 正文

Oracle11gDataGuard:HowtostartandstopRedoApply

1StartingRedoApplyTostartapplyservicesonaphysicalstandbydatabase,ensurethephysicalstandbydatabaseisstartedandmountedandthenstartRedoApplyusingtheSQLALTERDATABASERECOVERMANAGEDSTANDBYDATABASEstatement.You

1 Starting Redo Apply To start apply services on a physical standby database, ensure thephysical standby database is started and mounted and then start Redo Applyusing the SQL ALTER DATABASE RECOVER MANAGED STANDBY DATABASE statement. You

1 Starting Redo Apply

To start apply services on a physical standby database, ensure thephysical standby database is started and mounted and then start Redo Applyusing the SQL ALTER DATABASE RECOVER MANAGED STANDBY DATABASE statement.

You can specify that Redo Apply runs as a foreground session or as abackground process, and enable it with real-time apply.

  • To start Redo Apply in the foreground, issue the following SQL statement:
    SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE;

  • If you start a foreground session, control is not returned to the command prompt until recovery is canceled by another session.
  • To start Redo Apply in the background, include the DISCONNECT keyword on the SQL statement. For example:
    SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT;

alterdatabase recover managed standby database disconnect from session;

  • This statement starts a detached server process and immediately returns control to the user. While the managed recovery process is performing recovery in the background, the foreground process that issued the RECOVER statement can continue performing other tasks. This does not disconnect the current SQL session.
  • To start real-time apply, include the USING CURRENT LOGFILE clause on the SQL statement. For example:
    SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE;

alterdatabase recover managed standby database using current logfile disconnect fromsession;

2 Stopping Redo Apply

To stop Redo Apply, issue the following SQL statement:

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

3 Advanced Configuration

3.1 Using Real-Time Apply to ApplyRedo Data Immediately

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

Use the ALTER DATABASE statement to enable the real-time applyfeature, 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.

Real-time apply requires a standbydatabase that is configured with a standby redo log and that is in ARCHIVELOGmode.

The figure belowshowsa Data Guard configuration with a local destination and a standby destination.As the remote file server (RFS) process writes the redo data to standby redolog files on the standby database, apply services can recover redo from standbyredo log files as they are being filled.

3.2 Specifying a Time Delay for theApplication of Archived Redo Log Files

In some cases, you may want to create a time lag between the timewhen redo data is received from the primary site and when it is applied to thestandby database. You can specify a time interval (in minutes) to protectagainst the application of corrupted or erroneous data to the standby database.When you set a DELAY interval, it does not delay the transport of the redo datato the standby database. Instead, the time lag you specify begins when the redodata is completely archived at the standby destination.

Note:

If you define a delay for a destination that has real-time applyenabled, the delay is ignored.

Specifying a Time Delay

You can set a time delay on primary and standby databases using theDELAY=minutes attribute of theLOG_ARCHIVE_DEST_n initializationparameter to delay applying archived redo log files to the standby database. Bydefault, there is no time delay. If you specify the DELAY attribute withoutspecifying a value, then the default delay interval is 30 minutes.

Canceling a Time Delay

You can cancel a specified delay interval as follows:

  • For physical standby databases, use the NODELAY keyword of the RECOVER MANAGED STANDBY DATABASE clause:
    SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE NODELAY;
  • For logical standby databases, specify the following SQL statement:
    SQL> ALTER DATABASE START LOGICAL STANDBY APPLY NODELAY;

These commands result in apply services immediately beginning toapply archived redo log files to the standby database, before the time intervalexpires.

Using Flashback Database as anAlternative to Setting a Time Delay

As an alternative to setting an apply delay, you can use FlashbackDatabase to recover from the application of corrupted or erroneous data to thestandby database. Flashback Database can quickly and easily flash back astandby database to an arbitrary point in time.


作者:xiangsir

QQ:444367417

MSN:xiangsir@hotmail.com

推荐阅读
  • 本文深入探讨了SQL数据库中常见的面试问题,包括如何获取自增字段的当前值、防止SQL注入的方法、游标的作用与使用、索引的形式及其优缺点,以及事务和存储过程的概念。通过详细的解答和示例,帮助读者更好地理解和应对这些技术问题。 ... [详细]
  • 本文探讨了如何在Hive(基于Hadoop)环境中编写类似SQL的语句,以去除字段中的空格。特别是在处理邮政编码等数据时,去除特定位置的空格是常见的需求。 ... [详细]
  • 如何在SQL Server 2008中通过Profiler跟踪特定数据库及获取客户端信息
    本文介绍如何利用SQL Server Profiler工具来监控特定数据库的操作,并获取执行这些操作的客户端计算机名和账户名。步骤包括创建新的跟踪、配置跟踪属性以及设置列筛选器以精确过滤数据。 ... [详细]
  • 请看|间隔时间_Postgresql 主从复制 ... [详细]
  • 在进行QT交叉编译时,可能会遇到与目标架构不匹配的宏定义问题。例如,当为ARM或MIPS架构编译时,需要确保使用正确的宏(如QT_ARCH_ARM或QT_ARCH_MIPS),而不是默认的QT_ARCH_I386。本文将详细介绍如何正确配置编译环境以避免此类错误。 ... [详细]
  • 深入解析ESFramework中的AgileTcp组件
    本文详细介绍了ESFramework框架中AgileTcp组件的设计与实现。AgileTcp是ESFramework提供的ITcp接口的高效实现,旨在优化TCP通信的性能和结构清晰度。 ... [详细]
  • ArcXML:互联网空间数据交换的专用语言
    ArcXML是一种专为ArcIMS平台设计的数据交换协议,基于XML标准,用于在不同组件之间传输和描述地理空间数据。本文将详细介绍ArcXML的背景、用途及其与XML的关系。 ... [详细]
  • 本文详细介绍了Linux系统中的进程管理函数,涵盖了获取进程ID、用户ID、创建子进程、信号处理等关键操作。通过这些函数,开发者可以更好地控制和管理进程行为。 ... [详细]
  • KMP算法是处理字符串匹配的一种高效算法它首先用O(m)的时间对模板进行预处理,然后用O(n)的时间完成匹配。从渐进的意义上说,这样时间复 ... [详细]
  • 本文详细介绍了 Linux 系统中用户、组和文件权限的设置方法,包括基本权限(读、写、执行)、特殊权限(SUID、SGID、Sticky Bit)以及相关配置文件的使用。 ... [详细]
  • 序列化与反序列化是数据处理中的重要技术,特别是在网络通信和数据存储中。它们允许将复杂的数据结构转换为可传输或存储的格式,再从这些格式恢复原始数据。本文探讨了序列化与反序列化的基本概念,以及它们在不同协议模型中的角色。 ... [详细]
  • 解决Hive操作无响应问题:drop table和create table的处理方法
    本文详细介绍了在Hive中执行drop table和create table命令时遇到无响应的情况,并提供了完整的解决方案。通过调整MySQL字符集编码,确保Hive数据库与MySQL之间的兼容性,从而有效解决问题。 ... [详细]
  • 本文探讨了C#语言中类的嵌套使用,特别是当嵌套类作为方法参数时,其内部状态是否会因方法调用而发生改变的问题。通过实例分析,详细说明了引用类型在不同情况下的行为。 ... [详细]
  • 本文探讨了Hive作业中Map任务数量的确定方式,主要涉及HiveInputFormat和CombineHiveInputFormat两种InputFormat的分片计算逻辑。通过调整相关参数,可以有效控制Map任务的数量,进而优化Hive作业的性能。 ... [详细]
  • 深入解析8086 CPU的转移指令
    本文详细介绍了8086 CPU中的转移指令,包括无条件转移、条件转移、循环指令及过程调用等,同时探讨了offset操作符的功能及其应用实例。 ... [详细]
author-avatar
络风落泪_411
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有