| Oracle® Data Guard Concepts and Administration 10g Release 1 (10.1) Part Number B10823-01 |
|
|
View PDF |
Oracle 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 st andby databases as transactionally consistent 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 downt ime 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 option ally improve production database performance by offloading resource-intensive backup and reporting operations to standby systems.
This chapter includes the following topics that describe the highlights of Oracle Data Guard:< /p>
A Data Guard configuration consists of one production data base and one or more standby databases. The databases in a Data Guard configuration are connected by Oracle Net and may be dispersed geographically. There are no restrictions on where the databases are located, provided they can communicate with each other. For exam ple, you can have a standby database on the same system as the production database, along with two standby databases on other systems at remote locations.
You can manage primary and standby databases using the SQL command-li ne interfaces or the Data Guard broker interfaces, including a command-line interface (DGMGRL) and a graphical user interface that is integrated in Oracle Enterprise Manager.
A Data Guard configuration contains one production database, also referred to as the primary database, that functions in the primary role. This i s the database that is accessed by most of your applications.
The primary database can be e ither a single-instance Oracle database or an Oracle Real Application Clusters database.
A standby database is a transactionally consistent copy of the primary database. Using a backup c opy of the primary database, you can create up to nine standby databases and incorporate them in a Data Guard configuration. Once cre ated, Data Guard automatically maintains each standby database by transmitting redo data from the primary database and then applying the redo to the standby database.
Similar to a primary database, a standby database can be either a single-instance Oracle database or an Oracle Real Application Clusters database.
A standby database can be either a physical standby database or a logical standby database:
Pr ovides a physically identical copy of the primary database, with on disk database structures that are identical to the primary databa se 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 by recovering the redo data received from the primary database.
Contains the sa me 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 by transforming the data in the redo received from the prima ry database into SQL statements and then executing the SQL statements on the standby database. A logical standby database can be used for other business purposes in addition to disaster recovery requirements. This allows users to access a logical standby database fo r queries and reporting purposes at any time. Also, using a logical standby database, you can upgrade Oracle Database software and pa tch sets with almost no downtime. Thus, a logical standby database can be used concurrently for data protection, reporting, and datab ase upgrades.
Figure 1-1 shows a typical Data Guard configuration that contains a primary database instance that transmits redo data to a physical standby database. The physical standby database is remotely located from the primary database instance for disaster re covery and backup operations. You can configure the standby database at the same location as the primary database. However, for disas ter recovery purposes, Oracle recommends you configure standby databases at remote locations.
Figure 1-1 shows a typical Data Guard configuration in which archived redo log files are b eing applied to a physical standby database.
Text description of the illustration ps_config.gif
The following sections explain how Data Guard manages the transmission of redo data, the application of redo data, and changes to the database roles:
Control the automated transfer of redo data from the production database to one or more archival destination s.
Apply redo data on the standby database to maintain transactional synchronization with the primary datab ase. Redo data can be applied either from archived redo log files, or, if real-time apply is enabled, directly from the standby redo log files as they are being filled, without requiring the redo data to be archived first at the standby database.
Change the role of a database from a standby database to a primary database, or from a primary database to a standby dat abase using either a switchover or a failover operation.
Log transport services control the automated transfer of redo data from the producti on database to one or more archival destinations.
Log transport services perform the follow ing tasks:
The redo data transmitted from the primary database is written on the standby system into standby redo lo g files, if configured, and then archived into archived redo log files. Log apply services automaticall y apply the archived redo data on the standby database to maintain consistency with the primary database. It also allow read-only acc ess to the data.
The main difference between physical and logical standby databases is the manner in which log apply services apply the archived redo data:
Text description of the illustration redoapply.gif
Text description of the illustration sqlapply.gif
An Oracle database operates in one of two roles: primary or standby. Using Data Guard, you can change the role of a database using either a switchover or a failover operation. The services that control these aspects are called role management services.
A switchover is a role reversal between the primary database and one of its standby databases. A switchover guar antees 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. The transition occurs without having to re-c reate either database.
A failover is when the primary databas e is unavailable. Failover is performed only in the event of a catastrophic failure of the primary database, and the failover results in an irreversible transition of a standby database to the primary role. The database administrator can configure Data Guard to ensu re no data loss.
The Data Guard broker is a distributed management framework that automates and centralizes the creation, maintenance, and monitoring of Data Guard configurations. You can use either the Oracle Enterprise Manager graphical user interface (GUI) or command-line interface (CLI) to automate and simplify:
In addition, the Oracle Enterprise Manager GUI automates and simplifies:
Oracle Enterprise Manager ("Enterprise Manager") provides a Web-based interface for viewing, monitoring, and a dministering primary and standby databases in a Data Guard configuration. Enterprise Manager's easy-to-use interfaces combined with t he broker's centralized management and monitoring of the Data Guard configuration enhance the Data Guard solution for high availabili ty, site protection, and data protection of an enterprise. Figure 1-4 shows the Data Guard ma nagement overview page in Enterprise Manager.
Text description of the illustration emwindow.gif
From the Enterprise Manager Central Console, all manag ement operations can be performed locally or remotely. You can view home pages for Oracle databases, including primary and standby da tabases 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. See Oracle Data Guard Broker and the Oracle Enterprise Manager online help system.
The Data Guard CLI enables you to control and monitor a D ata Guard configuration from the CLI prompt (DGMGRL) or within scripts. You can perform most of the activities required to manage and monitor the databases in the configuration using the CLI. See Oracle Data Guard Broker for complete CLI reference information and examples.
In some situations, a business cannot afford to lose data. In other situations, the availability of the database may be more important than the loss of data. Some applications require m aximum database performance and can tolerate a potential loss of data. The following descriptions summarize the three distinct modes of data protection.
This protection mode guarantees that no data loss will occur if the primary database fails. To provide this level of protection, the redo data needed to recover each transaction must be written to both the local online redo log and to the standby redo log on at least one standby database before the transaction commits. To ens ure data loss cannot occur, the primary database shuts down if a fault prevents it from writing its redo stream to at least one remot e standby redo log.
This protection mode provides the highest level of data pro tection that is possible without compromising the availability of the primary database. Like maximum protection mode, a transaction w ill not commit until the redo needed to recover that transaction is written to the local online redo log and to at least one remote s tandby redo log. Unlike maximum protection mode, the primary database does not shut down if a fault prevents it from writing its redo stream to a remote standby redo log. Instead, the primary database operates in maximum performance mode until the fault is corrected , and all gaps in redo log files are resolved. When all gaps are resolved, the primary database automatically resumes operating in ma ximum availability mode.
This mode guarantees that no data loss will occur if the primary d atabase fails, but only if a second fault does not prevent a complete set of redo data from being sent from the primary database to a t least one standby database.
This protection mode (the default) provides the hi ghest level of data protection that is possible without affecting the performance of the primary database. This is accomplished by al lowing a transaction to commit as soon as the redo data needed to recover that transaction is written to the local online redo log. T he primary databases's redo data stream is also written to at least one standby database, but that redo stream is written asynchronou sly with respect to the commitment of the transactions that create the redo data.
When netw ork links with sufficient bandwidth are used, this mode provides a level of data protection that approaches that of maximum availabil ity mode with minimal impact on primary database performance.
The maximum protection and ma
ximum availability modes require that a standby redo log is configured on at least one standby database in the configuration. All thr
ee protection modes require that specific log transport attributes be specified on the LOG_ARCHIVE_DEST_n initialization
parameter to send redo data to at least one standby database. See Section 5.6 for compl
ete information about the data protection modes.
Oracle Database provides several unique technologies that complement Data Guard to help keep business critical syst ems running with greater levels of availability and data protection than when using any one solution by itself. The following list su mmarizes some Oracle high-availability technologies:
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. R AC and 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:
Many different architectures usin g RAC and Data Guard are possible depending on the use of local and remote sites and the use of nodes and a combination of logical an d physical standby databases. See Appendix B, "Data Guard and Real Application Clusters" an d Oracle High Availability Architecture and Best Practices for RAC and Data Guard integration.
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 change d or deleted can be accessed once again. This feature:
See Oracle Database Backup and Recovery Advance d User's Guide for information about Flashback Database, and Section 6.2.2 for info rmation delaying the application of redo data.
RMAN is an Oracle utility that simplifies backing up, restoring, and recovering database f iles. Like Data Guard, RMAN is a feature of the Oracle database and does not require separate installation. Data Guard is well integr ated with RMAN, allowing you to:
See Appendix D, "Creating a Physical Standby Database with Recovery Manager" and Oracle Database Backup and Recovery Basics.
Data Guard offers these benefits: p>
< a name="1037450">
Data Guard provides an efficient and comprehensive disaster recovery and high availability s olution. Easy-to-manage switchover and failover capabilities allow role reversals between primary and standby databases, minimizing t he downtime of the primary database for planned and unplanned outages.
With standby databases, Data Guard guarantees no data loss, even in the face of unforeseen disasters. A standby database provides a safeguard against data corruption and user errors. Storage level p hysical corruptions on the primary database do not propagate to the standby database. Similarly, logical corruptions or user errors t hat cause the primary database to be permanently damaged can be resolved. Finally, the redo data is validated when it is applied to t he standby database.
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 per form these tasks, saving valuable CPU and I/O cycles. With a logical standby database, users can perform normal data manipulation on tables in schemas that are not updated from the primary database. A logical standby database can remain open while the tables are upd ated from the primary database, and the tables are simultaneously available for read-only access. Finally, additional indexes and mat erialized views can be created on the maintained tables for better query performance and to suit specific business requirements.
< /li>Oracle Data Guard offers maximum protection, maximum availability, and maximu m performance modes to help enterprises balance data availability against system performance requirements.
If connectivity is lost between the primary and one or more standby databases (for example, due to network problems), redo data being generated on t he primary database cannot be sent to those standby databases. Once a connection is reestablished, the missing archived redo log file s (referred to as a gap) are automatically detected by Data Guard, which then automatically transmits the missing archived redo log f iles to the standby databases. The standby databases are synchronized with the primary database, without manual intervention by the D BA.
The Data Guard broker provides a graphical user interface and a command-line interface to automate management and operation al tasks across multiple databases in a Data Guard configuration. The broker also monitors all of the systems within a single Data Gu ard configuration.
Data Guard is a feature of Oracle Database Enterprise Edition and does not require separate installation.