Data Guard 1

来源:互联网 发布:怎样用c语言编写游戏 编辑:程序博客网 时间:2024/06/12 00:08
1 Introduction to Oracle Data GuardOracle Data Guard ensures high availability, data protection, and disaster recovery for enterprise data. 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. 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, Data Guard can switch any standby database to the production role, minimizing the downtime associated with the outage. Data Guard can be used with traditional backup, restoration, and cluster techniques to provide a high level of data protection and data availability.

With Data Guard, administrators can optionally improve production database performance by offloading resource-intensive backup and reporting operations to standby systems.

--DG优点还是很多的,高可用、数据保护、灾难恢复这些特点从名字就能看出来。它还能够把资源密集型的操作,比如备份、出报表等转移到备用系统上。

This chapter includes the following topics that describe the highlights of Oracle Data Guard:Data Guard ConfigurationsData Guard ServicesData Guard BrokerData Guard Protection ModesClient FailoverData Guard and Complementary TechnologiesSummary of Data Guard Benefits

1.1 Data Guard ConfigurationsDG由一个生产库(production database)和N个备库(standby database)。DG中的数据库通过Oracle Net连接,并且可以分配在不同的地域,这方面没有限制,设置把备库跟生产库放在同一个系统上也行。管理DG有三种接口,SQL命令行,DG Broker命令行(DGMGRL)和集成在OEM中的图形化用户接口。

1.1.1 Primary DatabaseA 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.--primary可以使单实例的数据库,也可以是Oracle RAC中的数据库。

1.1.2 Standby Databases利用主库,最多可以创建30个备库,它们是主库的一致事务性的副本。创建后,DG维护备库,从主库向备库传递redo数据,并且在备库上应用redo。和主库一样,备库也可以是单实例或者RAC备库类型有三种: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.主库有的,备库也有。通过Redo Apply同步主备库。注意了,从11g R1开始,physical standby可以在read-only状态下应用redo,这样就能起到既保护数据又能出报表的要求了。Logical Standby Database包含与主备相同的逻辑信息,但是数据的物理结构可以不同。logical standby是通过SQL Apply进行同步的,它会把从primary上接收的redo数据转换成SQL,然后在备库上应用。Logical standby除了能够满足灾难恢复,还能够做别的,比方说可以供用户查询,做报表,可以更新数据库软件,打补丁而不需要宕机,能够同时满足数据保护,查询报告和数据库升级。Snapshot Standby DatabaseSnapshot是一个完全可更新的备库,它也接收并且归档redo,但是不应用。在第一次忽略任何本地更新后它会被转成snapshot,在重新变成standby之前,它不会应用。一般在需要一个临时的,可更新的physical时候使用snapshot

1.1.3 Configuration ExampleThis shows a typical 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.--上图就是一个典型的DG配置。

1.2 Data Guard Services1.2.1Redo Transport Services1.2.2Apply Services1.2.3Role Transitions

1.2.1 Redo Transport ServicesRedo传输服务控制着从生产库到归档目的地的自动化redo数据传输,它有三个任务:从主库向备库传输redo数据;管理由于网络问题导致的归档文件的断层处理;自动检测备库系统上的归档丢失和归档损坏,自动从主库或其他备库上获取替换的归档文件

1.2.2 Apply Services从主库上传来的redo数据被写到备库上的standby redo log中。Apply services自动在备库上应用redo,可以通过只读方式访问数据。Physicallogical之间的主要区别就是apply services应用归档redo的方式。对于physicalDG使用Redo Apply技术,它在备库上通过恢复技术来应用redo,下图描述了这个过程。对于logicalDG使用SQL Apply,它会先把redo数据转换成SQL语句,然后在logical上执行产生的SQL,看下图。1.2.3 Role TransitionsOracle数据库有两种角色:primary & standby。通过DG,可以使用switchoverfailover来进行角色转换。Switchover能够确保没有数据丢失,一般都是有计划的对primary进行维护,switchover后主备之间角色互换。Failover是在主库已经不可用时使用。上面提到的两种方法是用SQL手动调用,也可以通过DG BrokerOEMDGMRGL来简化角色转换,自动化failovers

1.3 Data Guard Broker先来介绍一下DG Broker是什么:The Data Guard broker is a distributed management framework that automates the creation, maintenance, and monitoring of Data Guard configurations.是一个分布式的管理架构,能够使得DG的穿件,维护和监控自动化。下面的事儿既可以通过OEM的图形化用户接口,也可以通过DG的命令行接口DGMGRL来完成:a.Create and enable Data Guard configurations, including setting up redo transport services and apply servicesb.Manage an entire Data Guard configuration from any system in the configurationc.Manage and monitor Data Guard configurations that contain Oracle RAC primary or standby databasesd.Simplify switchovers and failovers by allowing you to invoke them using either a single key click in Oracle Enterprise Manager or a single command in the DGMGRL command-line interface.e.Enable fast-start failover to fail over automatically when the primary database becomes unavailable. When fast-start failover is enabled, the 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.--当主库unavailable时候,只要开启了fast-start failover就能够自动的进行fail over。当开启了fast-start failover时,DG broker会自动判断是否需要failover,并且不需要DBA干预就能够初始化failover到指定的目标备库上。

In addition, Oracle Enterprise Manager automates and simplifies:Creating a physical or logical standby database from a backup copy of the primary databaseAdding new or existing standby databases to an existing Data Guard configurationMonitoring log apply rates, capturing diagnostic information, and detecting problems quickly with centralized monitoring, testing, and performance tools--这个地方看看就好,没有DBA会用OEM去搞DG的。

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

From the Central Console of Enterprise Manager Grid Control, 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.

1.3.2 Using the Data Guard Command-Line InterfaceThe Data Guard command-line interface (DGMGRL) enables you to control and monitor a 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 for complete DGMGRL reference information and examples.

1.4 Data Guard Protection Modes有些企业不允许数据丢失,无论在任何环境下。而对于有些企业,数据库的可用性要比潜在的可能数据丢失更重要Maximum Availability这种模式在不影响数据库可用性的前提下提供最高级别的数据保护,只有事务产生的redo被写到online redo log和至少一个同步的standby redo log上,此事务才会提交。如果primary不能往至少一台同步standby上写redo stream,它就会自动转变成maximum performance,保证primary的可用性,等能够再写redo stream时候再变身回来。这种模式能够确保数据零丢失,但是不是所有情况,比方在standby宕掉后,primary也宕掉,祸不单行啊。

Maximum Performance这是默认的保护模式。在不影响数据库性能的前提下提供最高级别的数据保护。只要事务产生的redo被写到了online redo,此事务就允许提交。当然了产生的redo数据也要写到一个或多个库上,但是相对于redo提交而言是异步传输的,所以primary的性能不受redo传输影响。这种模式允许轻微的数据丢失,对primary性能影响最小。

Maximum Protection这个的级别高,即使primary出现问题了,也能够确保数据不丢失。它不同于maximum availability的是,当primary不能往至少一个同步的standbyredo流,那么primary就会把自己关机。

1.5 Client FailoverA 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.

1.6 Data Guard and Complementary TechnologiesOracle Real Application ClustersFlashback DatabaseRecovery Manager

1.7 Summary of Data Guard Benefits灾难恢复,数据保护,高可用完整数据保护系统资源的有效利用在可用性和性能中间灵活运用取得平衡自动gap检测和解决集中,简单管理与数据库整合

自动角色转换

原创粉丝点击