Data Guard Concepts and Administration:Introduction to Oracle Data Guard

个人自行阅读时候,翻译的文档。因为比较渣,如果有更合理或者错误的地方烦劳告知,我会做修改。
Oracle Data Guard ensures high availability, data protection, and disaster recovery for enterprise data. Oracle Data Guard provides a comprehensive set of services that create, maintain, manage, and monitor one or more standby databases to enable production Oracle databases to survive disasters and data corruptions. Oracle Data Guard maintains these standby databases as copies of the production database. Then, if the production database becomes unavailable because of a planned or an unplanned outage, Oracle Data Guard can switch any standby database to the production role, minimizing the downtime associated with the outage. Oracle Data Guard can be used with traditional backup, restoration, and cluster techniques to provide a high level of data protection and data availability. Oracle Data Guard transport services are also used by other Oracle features such as Oracle Streams and Oracle GoldenGate for efficient and reliable transmission of redo from a source database to one or more remote destinations.
Oracle Data Guard可确保企业数据的高可用性,数据保护和灾难恢复。 Oracle Data Guard提供了一套全面的服务,可以创建,维护,管理和监视一个或多个备用数据库,从而使生产上的Oracle数据库能够在灾难和数据损坏中生存。 Oracle Data Guard将这些备用数据库作为生产数据库的副本进行维护。然后,如果生产数据库由于计划或计划外中断而变得不可用,则Oracle Data Guard可以将任何备用数据库切换到生产角色,从而最大限度地减少与中断相关的停机时间。 Oracle Data Guard可以与传统的备份,恢复和集群技术结合使用,以提供的数据保护的高级别和数据可用性。 Oracle Data Guard传输服务也被其他Oracle功能部件(如Oracle Streams和Oracle GoldenGate)高效的用于从源数据库到一个或多个远程目标进行可靠的重做传输。
With Oracle Data Guard, administrators can optionally improve production database performance by offloading resource-intensive backup and reporting operations to standby systems.
使用Oracle Data Guard,管理员可以通过将资源密集型备份和报告分流到备用系统来选择性地提高生产数据库性能。
This chapter includes the following topics that describe the highlights of Oracle Data Guard:
■Oracle Data Guard Configurations
■Oracle Data Guard Services
■Oracle Data Guard Broker
■Oracle Data Guard Protection Modes
■Client Failover
■Oracle Data Guard and Complementary Technologies
■Summary of Oracle Data Guard Benefits
本章包括以下主题描述Oracle Data Guard的主要内容:
■Oracle Data Guard 配置
■Oracle Data Guard 服务
■Oracle Data Guard 代理
■Oracle Data Guard 保护模式
■客户端故障转移
■Oracle Data Guard 和 互补技术
■Oracle Data Guard 优点概述

1.1 Oracle Data Guard Configurations
An Oracle Data Guard configuration can contain one primary database and up to thirty destinations. The members of an Oracle Data Guard configuration are connected by Oracle Net and may be dispersed geographically. There are no restrictions on where the members of an Oracle Data Guard configuration are located as long as they can communicate with each other. For example, you can have a standby database in the same data center as the primary database, along with two standbys in another data center.
Oracle Data Guard配置可以包含一个主数据库和最多三十个目标。 Oracle Data Guard配置的成员由Oracle Net连接,可能在地理上分散。 只要Oracle Data Guard配置的成员可以彼此通信,就不会对其位置进行限制。 例如,您可以在与主数据库相同的数据中心中具有备用数据库,在另一个数据中心中具有两个备用数据库。
You can manage primary and standby databases using either the SQL command-line interface or the Oracle Data Guard broker interfaces. The broker provides a command-line interface (DGMGRL) and a graphical user interface that is integrated in Oracle Enterprise Manager Cloud Control.
您可以使用SQL命令行界面或Oracle Data Guard代理接口管理主数据库和备用数据库。 代理提供了集成在Oracle Enterprise Manager Cloud Control中的命令行界面(DGMGRL)和图形用户界面。
1.1.1 Primary Database
An Oracle Data Guard configuration contains one production database, also referred to as the primary database, that functions in the primary role. This is the database that is accessed by most of your applications.
The primary database can be either a single-instance Oracle database or an Oracle Real Application Clusters (Oracle RAC) database.
Oracle Data Guard配置包含一个生产数据库,也称为主数据库,在主角色中运行。 这是大多数应用程序访问的数据库。
主数据库可以是单实例Oracle数据库或Oracle Real Application Clusters(Oracle RAC)数据库。
1.1.2 Standby Databases
A standby database is a transactionally consistent copy of the primary database. Using a backup copy of the primary database, you can create up to thirty standby databases and incorporate them into an Oracle Data Guard configuration. Once created, Oracle Data Guard automatically maintains each standby database by transmitting redo data from the primary database and then applying the redo to the standby database.
备用数据库是主数据库的事务一致性副本。 使用主数据库的备份副本,您可以创建最多三十个备用数据库,并将它们合并到Oracle Data Guard配置中。 创建后,Oracle Data Guard通过从主数据库传输重做数据,然后将重做应用于备用数据库,自动维护每个备用数据库。
Similar to a primary database, a standby database can be either a single-instance Oracle database or an Oracle RAC database.
与主数据库类似,备用数据库可以是单实例Oracle数据库或Oracle RAC数据库。
The types of standby databases are as follows:
备用数据库的类型如下
■Physical standby database
Provides a physically identical copy of the primary database, with on disk database structures that are identical to the primary database on a block-for-block basis. The database schema, including indexes, are the same. A physical standby database is kept synchronized with the primary database, through Redo Apply, which recovers the redo data received from the primary database and applies the redo to the physical standby database.
提供主数据库的物理上相同的副本,在磁盘数据库结构上,这些数据库结构与基于块的块的主数据库完全相同。 数据库模式(包括索引)是相同的。 物理备用数据库通过重做应用保持与主数据库同步,恢复从主数据库接收的重做数据并将重做应用于物理备用数据库。
As of Oracle Database 11g Release 1 (11.1), a physical standby database can receive and apply redo while it is open for read-only access. A physical standby database can therefore be used concurrently for data protection and reporting.
从Oracle Database 11g第1版(11.1)开始,物理备用数据库可以在其处于只读访问状态时打开并接收并应用重做。 因此,物理备用数据库可以同时用于数据保护和报告。

Additionally, as of Oracle Database 11g Release 2 (11.2.0.1), a physical standby database can be used to install eligible one-off patches, patch set updates (PSUs), and critical patch updates (CPUs), in rolling fashion. For more information about this functionality, see the My Oracle Support note 1265700.1 at http://support.oracle.com.
此外,从Oracle Database 11g第2版(11.2.0.1)开始,物理备用数据库可用于以滚动方式安装合格的一次性修补程序,修补程序集更新(PSU)和关键修补程序更新(CPUs)。 有关此功能的详细信息,请参阅My Oracle Support说明1265700.1,网址为http://support.oracle.com

■Logical standby database
Contains the same logical information as the production database, although the physical organization and structure of the data can be different. The logical standby database is kept synchronized with the primary database through SQL Apply, which transforms the data in the redo received from the primary database into SQL statements and then executes the SQL statements on the standby database.
包含与生产数据库相同的逻辑信息,虽然数据的物理组织和结构可以不同。 逻辑备用数据库通过SQL 应用与主数据库保持同步,SQL 应用将从主数据库接收的重做数据转换为SQL语句,然后在备用数据库上执行SQL语句。
The flexibility of a logical standby database lets you upgrade Oracle Database software (patch sets and new Oracle Database releases) and perform other database maintenance in rolling fashion with almost no downtime. From Oracle Database 11g onward, the transient logical database rolling upgrade process can also be used with existing physical standby databases.
逻辑备用数据库的灵活性允许您升级Oracle数据库软件(修补程序集和新的Oracle数据库版本),并以滚动方式执行其他数据库维护,几乎没有停机时间。 从Oracle Database 11g开始,临时逻辑数据库滚动升级过程也可以与现有的物理备用数据库一起使用。
■Snapshot Standby Database
A snapshot standby database is a fully updatable standby database.
快照备用数据库是完全可更新的备用数据库。
Like a physical or logical standby database, a snapshot standby database receives and archives redo data from a primary database. Unlike a physical or logical standby database, a snapshot standby database does not apply the redo data that it receives. The redo data received by a snapshot standby database is not applied until the snapshot standby is converted back into a physical standby database, after first discarding any local updates made to the snapshot standby database.

与物理或逻辑备用数据库一样,快照备用数据库从主数据库接收和归档重做数据。 与物理或逻辑备用数据库不同,快照备用数据库不应用其接收的重做数据。 在快照备用数据库被转换回物理备用数据库之后,在首先丢弃对快照备用数据库进行的任何本地更新后,快照备用数据库接收的重做数据才会应用。

A snapshot standby database is best used in scenarios that require a temporary, updatable snapshot of a physical standby database. For example, you can use the Oracle Real Application Testing option to capture primary database workload and then replay it for test purposes on the snapshot standby. Note that because redo data received by a snapshot standby database is not applied until it is converted back into a physical standby, the time needed to recover from a primary database failure is directly proportional to the amount of redo data that needs to be applied.

快照备用数据库最适用于需要物理备用数据库的临时可更新快照的方案。 例如,您可以使用Oracle Real Application Testing选项捕获主数据库工作负载,然后在快照备用数据库上进行重放以进行测试。 请注意,由于快照备用数据库接收的重做数据在应用程序转换回物理备用数据库之前不会应用,因此从主数据库故障恢复所需的时间与需要应用的重做数据量成正比。

1.1.3 Far Sync Instances
An Oracle Data Guard far sync instance is a remote Oracle Data Guard destination that accepts redo from the primary database and then ships that redo to other members of the Oracle Data Guard configuration. A far sync instance manages a control file, receives redo into standby redo logs (SRLs), and archives those SRLs to local archived redo logs, but that is where the similarity with standbys ends. A far sync instance does not have user data files, cannot be opened for access, cannot run redo apply, and can never function in the primary role or be converted to any type of standby database.

Oracle Data Guard远程同步实例是一个远程Oracle Data Guard目标,它从主数据库接受重做,然后将该重做发送到Oracle Data Guard配置的其他成员。 远同步实例管理控制文件,接收重做到备用重做日志(SRLs),并将这些SRL归档到本地归档重做日志,但这是与备用数据库的相似性结束的地方。 远程同步实例没有用户数据文件,无法打开进行访问,无法运行重做应用程序,并且永远不能在主角色中运行或转换为任何类型的备用数据库。

Far sync instances are part of the Oracle Active Data Guard Far Sync feature, which requires an Oracle Active Data Guard license.

远程同步实例是Oracle Active Data Guard远程同步功能的一部分,需要Oracle Active Data Guard许可证。

1.1.4 Zero Data Loss Recovery Appliance
Zero Data Loss Recovery Appliance (Recovery Appliance) is an enterprise-level backup solution that provides a single repository for backups of all your Oracle databases.

零数据丢失恢复设备(恢复设备)是一种企业级备份解决方案,为所有Oracle数据库的备份提供单个存储库。

Recovery Appliance offloads most Oracle Database backup and restore processing to a centralized backup system. It enables you to achieve significant efficiencies in storage utilization, performance, and manageability of backups.

恢复设备将大多数Oracle数据库备份和恢复处理卸载到集中式备份系统。 它使您能够在存储利用率,性能和备份的可管理性方面实现显着的效率。

Transport of redo data to a Recovery Appliance is supported in a Data Guard configuration, as of Oracle Database 12c release 1 (12.1.0.2).

从Oracle Database 12c第1版(12.1.0.2)开始,Data Guard配置支持将恢复数据传输到恢复应用装置。

1.1.5 Configuration Example
Figure 1-1 shows a typical Oracle Data Guard configuration that contains a primary database that transmits redo data to a standby database. The standby database is remotely located from the primary database for disaster recovery and backup operations. You can configure the standby database at the same location as the primary database. However, for disaster recovery purposes, Oracle recommends you configure standby databases at remote locations.

图1-1显示了典型的Oracle Data Guard配置,其中包含将重做数据传输到备用数据库的主数据库。 备用数据库远离主数据库,用于灾难恢复和备份操作。 您可以将备用数据库配置在与主数据库相同的位置。 但是,为了灾难恢复目的,Oracle建议您在远程位置配置备用数据库。

Figure 1-1 Typical Oracle Data Guard Configuration
(https://docs.oracle.com/database/121/SBYDB/img/sbydb042.gif)[Description of ''Figure 1-1 Typical Oracle Data Guard Configuration'']

1.2 Oracle Data Guard Services
The following sections explain how Oracle Data Guard manages the transmission of redo data, the application of redo data, and changes to the database roles:

以下部分解释了Oracle Data Guard如何管理重做数据的传输,重做数据的应用程序和数据库角色的更改:

■Redo Transport Services
Control the automated transfer of redo data from the production database to one or more archival destinations.

控制重做数据从生产数据库到一个或多个归档目标的自动传输。

■Apply Services
Redo data is applied directly from standby redo log files as they are filled using real-time apply. If standby redo log files are not configured, then redo data must first be archived at the standby database before it is applied.

重做数据在使用实时应用程序填充时直接从备用重做日志文件应用。 如果未配置备用重做日志文件,则重做数据必须先在备用数据库中归档,然后再应用。

■Role Transitions
Change the role of a database from a standby database to a primary database, or from a primary database to a standby database using either a switchover or a failover operation.

使用切换或故障转移操作将数据库的角色从备用数据库更改为主数据库,或从主数据库更改为备用数据库。

1.2.1 Redo Transport Services
Redo transport services control the automated transfer of redo data from the production database to one or more archival destinations.

重做传输服务控制重做数据从生产数据库到一个或多个归档目的地的自动传输。

Redo transport services perform the following tasks:
■Transmit redo data from the primary system to the standby systems in the configuration
■Manage the process of resolving any gaps in the archived redo log files due to a network failure
■Automatically detect missing or corrupted archived redo log files on a standby system and automatically retrieve replacement archived redo log files from the primary database or another standby database

■在配置中将重做数据从主系统传输到备用系统
■管理由于网络故障而解决归档重做日志文件中的任何空白的过程
■在备用系统上自动检测缺失或损坏的归档重做日志文件,并从主数据库或其他备用数据库自动检索替换归档重做日志文件

1.2.2 Apply Services
The redo data transmitted from the primary database is written to the standby redo log on the standby database. Apply services automatically apply the redo data on the standby database to maintain consistency with the primary database. It also allows read-only access to the data.

从主数据库传输的重做数据将写入备用数据库上的备用重做日志。 应用服务会自动在备用数据库上应用重做数据,以保持与主数据库的一致性。 它还允许只读访问数据。

The main difference between physical and logical standby databases is the manner in which apply services apply the archived redo data:
■For physical standby databases, Oracle Data Guard uses Redo Apply technology, which applies redo data on the standby database using standard recovery techniques of an Oracle database, as shown in [Figure 1-2]
Figure 1-2 Automatic Updating of a Physical Standby Database

Description of Figure 1-2 follows
Description of Figure 1-2 follows
Description of ''Figure 1-2 Automatic Updating of a Physical Standby Database ''

物理和逻辑备用数据库之间的主要区别是应用服务应用归档重做数据的方式:
对于物理备用数据库,Oracle Data Guard使用Redo Apply技术,它使用Oracle数据库的标准恢复技术在备用数据库上应用重做数据,如[图1-2]

■For logical standby databases, Oracle Data Guard uses SQL Apply technology, which first transforms the received redo data into SQL statements and then executes the generated SQL statements on the logical standby database, as shown in [Figure 1-3]
Figure 1-3 Automatic Updating of a Logical Standby Database

Description of Figure 1-3 follows
Description of Figure 1-3 follows
Description of ''Figure 1-3 Automatic Updating of a Logical Standby Database''

对于逻辑备数据库,Oracle Data Guard使用SQL Apply技术,首先将接收的重做数据转换为SQL语句,然后在逻辑备数据库上执行生成的SQL语句,如图1-3所示。

1.2.3 Role Transitions
An Oracle database operates in one of two roles: primary or standby. Using Oracle Data Guard, you can change the role of a database using either a switchover or a failover operation.

Oracle数据库以两种角色之一运行:主数据库或备用数据库。 使用Oracle Data Guard,您可以使用切换或故障转移操作更改数据库的角色。

A switchover is a role reversal between the primary database and one of its standby databases. A switchover ensures no data loss. This is typically done for planned maintenance of the primary system. During a switchover, the primary database transitions to a standby role, and the standby database transitions to the primary role.

切换是主数据库与其一个备用数据库之间的角色颠倒。 切换确保没有数据丢失。 这通常用于主系统的计划维护。 在切换期间,主数据库转换为备用角色,并且备用数据库转换为主角色。

A failover is when the primary database is unavailable. Failover is performed only in the event of a failure of the primary database, and the failover results in a transition of a standby database to the primary role. The database administrator can configure Oracle Data Guard to ensure no data loss.

故障转移是指主数据库不可用。 仅在主数据库发生故障的情况下执行故障转移,并且故障转移会导致备用数据库转换为主要角色。 数据库管理员可以配置Oracle Data Guard,以确保没有数据丢失。

The role transitions described in this documentation are invoked manually using SQL statements. You can also use the Oracle Data Guard broker to simplify role transitions and automate failovers using Oracle Enterprise Manager Cloud Control or the DGMGRL command-line interface, as described in [Section 1.3]

本文档中描述的角色转换是使用SQL语句手动调用的。 您还可以使用Oracle Data Guard代理来简化角色转换,并使用Oracle Enterprise Manager Cloud Control或DGMGRL命令行界面自动执行故障切换,如[第1.3节]

1.3 Oracle Data Guard Broker
The Oracle Data Guard broker is a distributed management framework that automates the creation, maintenance, and monitoring of Oracle Data Guard configurations. You can use either the Oracle Enterprise Manager Cloud Control graphical user interface (GUI) or the Oracle Data Guard command-line interface (DGMGRL) to:
■Create and enable Oracle Data Guard configurations, including setting up redo transport services and apply services
■Manage an entire Oracle Data Guard configuration from any system in the configuration
■Manage and monitor Oracle Data Guard configurations that contain Oracle RAC primary or standby databases
■Simplify switchovers and failovers by allowing you to invoke them using either a single key click in Oracle Enterprise Manager Cloud Control or a single command in the DGMGRL command-line interface.
■Enable Oracle Data Guard fast-start failover to fail over automatically when the primary database becomes unavailable. When fast-start failover is enabled, the Oracle Data Guard broker determines if a failover is necessary and initiates the failover to the specified target standby database automatically, with no need for DBA intervention.

Oracle Data Guard代理是一种分布式管理框架,可自动创建,维护和监视Oracle Data Guard配置。 您可以使用Oracle Enterprise Manager Cloud Control图形用户界面(GUI)或Oracle Data Guard命令行界面(DGMGRL):
■创建和启用Oracle Data Guard配置,包括设置重做传输服务和应用服务
■从配置中的任何系统管理整个Oracle Data Guard配置
■管理和监视包含Oracle RAC主数据库或备用数据库的Oracle Data Guard配置
■通过允许您使用Oracle Enterprise Manager Cloud Control中的单个键单击或DGMGRL命令行界面中的单个命令来调用切换和故障切换,从而简化切换和故障切换。
■启用Oracle Data Guard快速启动故障切换,以在主数据库不可用时自动故障转移。 启用快速启动故障转移后,Oracle Data Guard代理会确定是否需要故障转移,并自动启动到指定目标备用数据库的故障转移,而无需DBA干预。

In addition, Oracle Enterprise Manager Cloud Control automates and simplifies:
■Creating a physical or logical standby database from a backup copy of the primary database
■Adding new or existing standby databases to an existing Oracle Data Guard configuration
■Monitoring log apply rates, capturing diagnostic information, and detecting problems quickly with centralized monitoring, testing, and performance tools

此外,Oracle企业管理器云控制可自动化和简化:
■从主数据库的备份副本创建物理或逻辑备用数据库
■将新的或现有的备用数据库添加到现有的Oracle Data Guard配置
■使用集中式监控,测试和性能工具,监控日志应用速率,捕获诊断信息以及快速检测问题

1.3.1 Using Oracle Enterprise Manager Cloud Control
Oracle Enterprise Manager Cloud Control (sometimes referred to simply as Cloud Control in this book) provides a web-based interface for viewing, monitoring, and administering primary and standby databases in an Oracle Data Guard configuration. Enterprise Manager's easy-to-use interfaces, combined with the broker's centralized management and monitoring of the Oracle Data Guard configuration, enhance the Oracle Data Guard solution for high availability, site protection, and data protection of an enterprise.

Oracle企业管理器云控制(本书中有时简称为Cloud Control)提供了一个基于Web的界面,用于在Oracle Data Guard配置中查看,监视和管理主数据库和备用数据库。 企业管理器的易于使用的接口,与代理的Oracle Data Guard配置的集中管理和监控相结合,增强了Oracle Data Guard解决方案的高可用性,站点保护和企业的数据保护。

Using Enterprise Manager, you can perform all management operations either locally or remotely. You can view home pages for Oracle databases, including primary and standby databases and instances, create or add existing standby databases, start and stop instances, monitor instance performance, view events, schedule jobs, and perform backup and recovery operations.

使用企业管理器,您可以在本地或远程执行所有管理操作。 您可以查看Oracle数据库的主页,包括主数据库和备用数据库和实例,创建或添加现有备用数据库,启动和停止实例,监视实例性能,查看事件,计划作业以及执行备份和恢复操作。

1.3.2 Using the Oracle Data Guard Command-Line Interface
The Oracle Data Guard command-line interface (DGMGRL) enables you to control and monitor an Oracle Data Guard configuration from the DGMGRL prompt or within scripts. You can perform most of the activities required to manage and monitor the databases in the configuration using DGMGRL. See [Oracle Data Guard Broker]

Oracle Data Guard命令行界面(DGMGRL)使您能够从DGMGRL提示符或脚本中控制和监视Oracle Data Guard配置。 您可以使用DGMGRL执行在配置中管理和监视数据库所需的大多数活动。 请参见[Oracle Data Guard Broker]

1.4 Oracle Data Guard Protection Modes
In some situations, a business cannot afford to lose data regardless of the circumstances. In other situations, the availability of the database may be more important than any potential data loss in the unlikely event of a multiple failure. Finally, some applications require maximum database performance at all times, and can therefore tolerate a small amount of data loss if any component should fail. The following descriptions summarize the three distinct modes of data protection.

在某些情况下,企业不能在任何情况下丢失数据。 在其他情况下,数据库的可用性可能比在多个故障的不太可能的事件中的任何潜在数据丢失更重要。 最后,一些应用程序在任何时候都需要最大的数据库性能,因此如果任何组件出现故障,可以容忍少量的数据丢失。 以下描述总结了三种不同的数据保护模式。

Maximum availability This protection mode provides the highest level of data protection that is possible without compromising the availability of a primary database. With Oracle Data Guard, transactions do not commit until all redo data needed to recover those transactions has either been received in memory or written to the standby redo log (depending upon configuration) on at least one synchronized standby database. If the primary database cannot write its redo stream to at least one synchronized standby database, it operates as if it were in maximum performance mode to preserve primary database availability until it is again able to write its redo stream to a synchronized standby database.
This protection mode ensures zero data loss except in the case of certain double faults, such as failure of a primary database after failure of the standby database.

最大可用性此保护模式可提供最高级别的数据保护,而不会影响主数据库的可用性。 使用Oracle Data Guard,事务不会提交,直到恢复这些事务所需的所有重做数据都已在内存中接收或写入至少一个同步备用数据库上的备用重做日志(取决于配置)。 如果主数据库无法将其重做流写入至少一个同步备用数据库,则它会像在最大性能模式下一样操作,以保留主数据库可用性,直到它再次能够将其重做流写入同步备用数据库。
此保护模式确保零数据丢失,除非在某些双重故障的情况下,例如主数据库在备用数据库故障后故障。

Maximum performance This is the default protection mode. It provides the highest level of data protection that is possible without affecting the performance of a primary database. This is accomplished by allowing transactions to commit as soon as all redo data generated by those transactions has been written to the online log. Redo data is also written to one or more standby databases, but this is done asynchronously with respect to transaction commitment, so primary database performance is unaffected by delays in writing redo data to the standby database(s).
This protection mode offers slightly less data protection than maximum availability mode and has minimal impact on primary database performance.

最大性能这是默认保护模式。 它提供了最高级别的数据保护,而且不会影响主数据库的性能。 这是通过允许事务在这些事务生成的所有重做数据都已写入联机日志后立即提交来实现的。 重做数据也被写入一个或多个备用数据库,但这是相对于事务提交是异步完成的,所以主数据库性能不受到将备用数据写入备用数据库的延迟的影响。
此保护模式提供比最大可用性模式少的数据保护,并且对主数据库性能影响最小。

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.

最大保护此保护模式确保在主数据库发生故障时不会发生数据丢失。 要提供此级别的保护,在事务提交之前,恢复事务所需的重做数据必须写入至少一个同步备用数据库中的联机重做日志和备用重做日志。 为了确保不会发生数据丢失,如果主数据库无法将其重做流写入至少一个同步的备用数据库,则主数据库将关闭,而不是继续处理事务。

All three protection modes require that specific redo transport options be used to send redo data to at least one standby database. See Chapter 6, "Oracle Data Guard Protection Modes" for more information about setting the protection mode of a primary database.

所有三种保护模式都需要使用特定的重做传输选项将重做数据发送到至少一个备用数据库。 有关设置主数据库的保护模式的详细信息,请参见第6章“Oracle Data Guard保护模式”。

1.5 Client Failover
A high availability architecture requires a fast failover capability for databases and database clients.
Client failover encompasses failure notification, stale connection cleanup, and transparent reconnection to the new primary database. Oracle Database provides the capability to integrate database failover with failover procedures that automatically redirect clients to a new primary database within seconds of a database failover.

高可用性架构需要数据库和数据库客户端的快速故障转移功能。
客户端故障转移包括故障通知,过时的连接清除和透明重新连接到新的主数据库。 Oracle数据库提供了将数据库故障转移与故障转移过程相集成的功能,该过程在数据库故障转移后的几秒钟内自动将客户端重定向到新的主数据库。

1.5.1 Application Continuity
Application Continuity is an Oracle Database feature that enables rapid and nondisruptive replays of requests against the database after a recoverable error that made the database session unavailable.

应用程序连续性是一种Oracle数据库功能,可在发生使数据库会话不可用的可恢复错误后,对数据库进行快速和无中断的请求重放。

Application Continuity is supported for Oracle Data Guard switchovers to physical standby databases. It is also supported for fast-start failover to physical standbys in maximum availability data protection mode. Note that primary and standby databases must be licensed for Oracle RAC or Oracle Active Data Guard in order to use Application Continuity.

支持将Oracle Data Guard切换到物理备用数据库的应用程序连续性。 它还支持在最大可用性数据保护模式下快速启动故障转移到物理备用数据库。 请注意,主数据库和备用数据库必须获得Oracle RAC或Oracle Active Data Guard许可才能使用应用程序连续性。

1.6 Oracle Data Guard and Complementary Technologies
Oracle Database provides several unique technologies that complement Oracle Data Guard to help keep business critical systems running with greater levels of availability and data protection than when using any one solution by itself. The following list summarizes some Oracle high-availability technologies:

Oracle数据库提供了几种独特的技术来补充Oracle Data Guard,帮助保持关键业务系统运行的可用性和数据保护级别高于单独使用任何一个解决方案。 以下列表总结了一些Oracle高可用性技术:

Oracle Real Application Clusters (Oracle RAC)
Oracle RAC enables multiple independent servers that are linked by an interconnect to share access to an Oracle database, providing high availability, scalability, and redundancy during failures. Oracle RAC and Oracle Data Guard together provide the benefits of both system-level, site-level, and data-level protection, resulting in high levels of availability and disaster recovery without loss of data:
–Oracle RAC addresses system failures by providing rapid and automatic recovery from failures, such as node failures and instance crashes. It also provides increased scalability for applications.
–Oracle Data Guard addresses site failures and data protection through transactionally consistent primary and standby databases that do not share disks, enabling recovery from site disasters and data corruption.
Oracle RAC支持由互连链接的多个独立服务器,以共享对Oracle数据库的访问,从而在故障期间提供高可用性,可扩展性和冗余。 Oracle RAC和Oracle Data Guard一起提供系统级,站点级和数据级保护的优势,从而实现高级别的可用性和灾难恢复,而不会丢失数据:

  • Oracle RAC通过从故障(例如节点故障和实例崩溃)提供快速和自动恢复来解决系统故障。 它还为应用程序提供了更高的可扩展性。
  • Oracle Data Guard通过事务一致的主数据库和备用数据库解决站点故障和数据保护,这些数据库不共享磁盘,从而实现从站点灾难和数据损坏进行恢复。

Many different architectures using Oracle RAC and Oracle Data Guard are possible depending on the use of local and remote sites and the use of nodes and a combination of logical and physical standby databases. See [Appendix D, "Oracle Data Guard and Oracle Real Application Clusters"]

根据本地和远程站点的使用以及节点以及逻辑和物理备用数据库的组合,使用Oracle RAC和Oracle Data Guard的许多不同架构都是可能的。 请参见[附录D,“Oracle Data Guard和Oracle Real应用程序集群”

■Oracle Real Application Clusters One Node (Oracle RAC One Node)
Oracle RAC One Node provides enhanced high availability for noncluster databases, protecting them from both planned and unplanned downtime. Oracle RAC One Node provides the following:
–Always-on noncluster database services
–Better consolidation for database servers
–Enhanced server virtualization
– Lower cost development and test platform for full Oracle RAC

Oracle RAC One Node为非集群数据库提供增强的高可用性,从而避免计划内和计划外停机。 Oracle RAC One Node提供以下功能:

  • 始终启用非集群数据库服务
  • 更好合并数据库服务
  • 增强服务器虚拟化
  • 降低整个Oracle RAC的成本开发和测试平台

In addition, Oracle RAC One Node facilitates the consolidation of database storage, standardizes your database environment, and, when necessary, enables you to upgrade to a full, multinode Oracle RAC database without downtime or disruption.
As of Oracle Database 11g Release 2 (11.2.0.2), Oracle Data Guard and Oracle Data Guard broker are fully integrated with Oracle Real Application Clusters One Node (Oracle RAC One Node).

此外,Oracle RAC One Node有助于数据库存储的整合,标准化数据库环境,并在必要时使您能够升级到完整的多节点Oracle RAC数据库,而不会停机或中断。
从Oracle数据库11g第2版(11.2.0.2)开始,Oracle Data Guard和Oracle Data Guard代理与Oracle Real Application集群节点(Oracle RAC One Node)完全集成。

■Flashback Database
The Flashback Database feature provides fast recovery from logical data corruption and user errors. By allowing you to flash back in time, previous versions of business information that might have been erroneously changed or deleted can be accessed once again. This feature:
–Eliminates the need to restore a backup and roll forward changes up to the time of the error or corruption. Instead, Flashback Database can roll back an Oracle database to a previous point-in-time, without restoring data files.
–Provides an alternative to delaying the application of redo to protect against user errors or logical corruptions. Therefore, standby databases can be more closely synchronized with the primary database, thus reducing failover and switchover times.
–Avoids the need to completely re-create the original primary database after a failover. The failed primary database can be flashed back to a point in time before the failover and converted to be a standby database for the new primary database.

闪回数据库功能提供从逻辑数据损坏和用户错误的快速恢复。 通过允许您及时闪回,可以再次访问可能已错误更改或删除的业务信息的先前版本。 此功能:

  • 减少需要恢复备份,并向前滚动更改到出错或损坏的时间。 相反,闪回数据库可以将Oracle数据库回滚到上一个时间点,而不恢复数据文件。
  • 提供替代方案来延迟重做的应用程序,以防止用户错误或逻辑损坏。 因此,备用数据库可以与主数据库更紧密地同步,从而减少故障转移和切换时间。
  • 不需要在故障转移后完全重新创建原始主数据库。 故障主数据库可以闪回到故障转移之前的时间点,并转换为新主数据库的备用数据库。

Recovery Manager (RMAN)
RMAN is an Oracle utility that simplifies backing up, restoring, and recovering database files. Like Oracle Data Guard, RMAN is a feature of the Oracle database and does not require separate installation. Oracle Data Guard is well integrated with RMAN, allowing you to:
–Use the Recovery Manager DUPLICATE command to create a standby database from backups of your primary database.
–Take backups on a physical standby database instead of the production database, relieving the load on the production database and enabling efficient use of system resources on the standby site. Moreover, backups can be taken while the physical standby database is applying redo.
–Help manage archived redo log files by automatically deleting the archived redo log files used for input after performing a backup.

RMAN是一个Oracle实用程序,可简化数据库文件的备份,恢复和恢复。 与Oracle Data Guard一样,RMAN是Oracle数据库的一项功能,不需要单独安装。 Oracle Data Guard与RMAN充分集成,允许您:

  • 使用Recovery Manager DUPLICATE命令从主数据库的备份创建备用数据库。
  • 在物理备用数据库而不是生产数据库上进行备份,减轻生产数据库上的负载,并有效利用备用站点上的系统资源。 此外,可以在物理备用数据库应用重做时进行备份。
  • 通过在执行备份后自动删除用于输入的归档重做日志文件来管理归档重做日志文件。

■Global Data Services (GDS)
Global Data Services applies the Oracle RAC service model to pools of globally distributed databases, providing dynamic load balancing, failover, and centralized service management for a set of replicated databases that offer common services. The set of databases can include Oracle RAC and single-instance Oracle databases interconnected through Oracle Data Guard, Oracle GoldenGate, or any other replication technology.
GDS is integrated with Oracle Data Guard broker. This allows role-specific global services to be automatically started and stopped as appropriate when role transitions occur within an Oracle Data Guard broker configuration.
GDS allows the specification of a replication lag limit for a global service. If the lag limit is exceeded at a given replica, the global service is temporarily stopped at that replica and new client requests are routed to a replica that satisfies the lag limit. The global service is automatically restarted at the original replica when the replication lag becomes less than the lag limit.

全球数据服务将Oracle RAC服务模型应用于全球分布式数据库池,为一组提供公共服务的复制数据库提供动态负载平衡,故障转移和集中式服务管理。该组数据库可以包括Oracle RAC和通过Oracle Data Guard,Oracle GoldenGate或任何其他复制技术互连的单实例Oracle数据库。
GDS与Oracle Data Guard代理集成。这允许在Oracle Data Guard代理配置中发生角色转换时,适当地自动启动和停止特定于角色的全局服务。
GDS允许规定全局服务的复制延迟限制。如果在给定副本处超过滞后限制,则全局服务在该副本处暂时停止,并且新客户端请求被路由到满足滞后限制的副本。当复制滞后变为小于滞后限制时,全局服务将在原始副本上自动重新启动。

1.7 Summary of Oracle Data Guard Benefits
Oracle Data Guard offers these benefits:
■Disaster recovery, data protection, and high availability
Oracle Data Guard provides an efficient and comprehensive disaster recovery and high availability solution. Easy-to-manage switchover and failover capabilities allow role reversals between primary and standby databases, minimizing the downtime of the primary database for planned and unplanned outages.

■灾难恢复,数据保护和高可用性
Oracle Data Guard提供了一种高效,全面的灾难恢复和高可用性解决方案。 易于管理的切换和故障切换功能允许主数据库和备用数据库之间的角色颠倒,从而最大程度地减少计划内和计划外中断的主数据库的停机时间。

■Complete data protection
Oracle Data Guard can ensure zero data loss, even in the face of unforeseen disasters. A standby database provides a safeguard against unplanned outages of all types, including data corruption and administrative error. Because the redo data received from a primary database is validated at a standby database, physical corruptions that can occur at a primary database are not propagated to the standby database. Additional validation performed at a standby database also prevents logical intra-block corruptions and lost-write corruptions from propagating to the standby. Similarly, administrative errors such as accidental file deletions by a storage administrator are not propagated to a standby database. A physical standby database can also be used to protect against user errors either by delaying the redo apply or by using Flashback Database to rewind the standby and extract a good copy of the data.

Oracle Data Guard可以确保零数据丢失,即使面对不可预见的灾难。 备用数据库提供了防止所有类型的计划外中断的保护措施,包括数据损坏和管理错误。 因为从主数据库接收的重做数据在备用数据库上进行验证,所以可能发生在主数据库中的物理损坏不会传播到备用数据库。 在备用数据库上执行的附加验证还防止逻辑块内损坏和丢失写入损坏传播到备用数据库。 类似地,存储管理员意外删除文件等管理错误不会传播到备用数据库。 物理备用数据库还可用于通过延迟重做应用或使用闪回数据库来倒回备用数据库并提取数据的良好副本来防止用户错误。

Efficient use of system resources
The standby database tables that are updated with redo data received from the primary database can be used for other tasks such as backups, reporting, summations, and queries, thereby reducing the primary database workload necessary to perform these tasks, saving valuable CPU and I/O cycles.

使用从主数据库接收的重做数据更新的备用数据库表可用于其他任务,例如备份,报告,求和和查询,从而减少执行这些任务所需的主数据库工作量,节省宝贵的CPU和I / O循环。

Flexibility in data protection to balance availability against performance requirements
Oracle Data Guard offers maximum protection, maximum availability, and maximum performance modes to help enterprises balance data availability against system performance requirements.

在数据保护方面的灵活性,以便根据性能要求平衡可用性
Oracle Data Guard提供最大的保护,最大可用性和最高性能模式,帮助企业根据系统性能要求平衡数据可用性。

■ Automatic gap detection and resolution
If connectivity is lost between the primary and one or more standby databases (for example, due to network problems), redo data being generated on the primary database cannot be sent to those standby databases. Once a connection is reestablished, the missing archived redo log files (referred to as a gap) are automatically detected by Oracle Data Guard, which then automatically transmits the missing archived redo log files to the standby databases. The standby databases are synchronized with the primary database, without manual intervention by the DBA.

■自动间隙检测和处理
如果主数据库和一个或多个备用数据库之间的连接丢失(例如,由于网络问题),则无法将主数据库上生成的重做数据发送到这些备用数据库。 重新建立连接后,Oracle Data Guard会自动检测丢失的归档重做日志文件(称为差异),然后自动将丢失的归档重做日志文件传输到备用数据库。 备用数据库与主数据库同步,无需DBA手动干预。

■Centralized and simple management
The Oracle Data Guard broker provides a graphical user interface and a command-line interface to automate management and operational tasks across multiple databases in an Oracle Data Guard configuration. The broker also monitors all of the systems within a single Oracle Data Guard configuration.

■集中,简单的管理
Oracle Data Guard代理提供了图形用户界面和命令行界面,可在Oracle Data Guard配置中跨多个数据库自动执行管理和操作任务。 代理还监视单个Oracle Data Guard配置中的所有系统。

■Integration with Oracle Database
Oracle Data Guard is a feature of Oracle Database Enterprise Edition and does not require separate installation.

■与Oracle数据库集成
Oracle Data Guard是Oracle数据库企业版的一项功能,不需要单独安装。

■Automatic role transitions
When fast-start failover is enabled, the Oracle Data Guard broker automatically fails over to a synchronized standby site in the event of a disaster at the primary site, requiring no intervention by the DBA. In addition, applications are automatically notified of the role transition.
■自动角色转换
启用快速启动故障切换时,如果主站点发生灾难,Oracle Data Guard代理将自动故障转移到同步备用站点,而不需要DBA的干预。 此外,应用程序会自动通知角色转换。

推荐阅读更多精彩内容