Oracle9i Data Guard Concepts and Administration
Release 1 (9.0.1)

Part Number A88808-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to next page

1
i Data Guard Concepts

Many organizations today depend on continuous access to data and computing resources. The interruption of computing services due to hardware failures, software failures, or human errors can result in the interruption of database access for primary business functions. When business data is unavailable, the consequences can range from merely inconveniencing certain users, to more severe effects like harming the financial health of the organization.

Oracle9i Data Guard provides a complete set of data protection and disaster recovery features to help you to survive mistakes, corruptions, and disasters that can destroy a database.

This chapter explains Oracle9i Data Guard concepts. It includes the following topics:

1.1 Oracle9i Data Guard Overview

Oracle9i Data Guard works with standby databases to protect your data against errors, failures, and corruptions that might otherwise destroy your database. It protects critical data by automating the creation, management, and monitoring aspects of a standby database environment. It automates the otherwise manual process of maintaining a transactionally consistent copy of an Oracle production database for the purpose of recovering from the loss or damage of the production database.

Without Oracle9i Data Guard, the database administrator (DBA) must copy archived redo logs to the remote host and apply them so that the primary database and standby database remain synchronized. Oracle9i Data Guard automates the tasks involved in setting up and managing the Data Guard environment, including one or more standby databases, the log transport services, log apply services, role management services, and related applications.

Generally, redo logs are transferred from the primary database to the standby database as they are archived. However, Oracle9i Data Guard provides the DBA with great flexibility when defining archive destinations, archive completion requirements, I/O failure handling, and automated transmission restart capability.

For example:

You can perform administrative tasks using the Oracle9i Data Guard Manager graphical user interface, the Data Guard command-line interface, or SQL statements.

Figure 1-1 shows an example of a Data Guard configuration that allows failover to occur to either of two standby systems. If the primary site becomes unavailable, the workload can fail over to either standby site.

Figure 1-1 Oracle9i Data Guard Configuration


Text description of odg_new.gif follows.
Text description of the illustration odg_new.gif

Oracle9i Data Guard helps you survive events that might otherwise destroy your database by:

1.2 Operational Requirements

Note the following operational requirements for maintaining a standby database:

1.3 Oracle Data Guard Architecture

The Oracle9i Data Guard architecture consists of the following components:

Figure 1-2 Data Guard Architecture


Text description of odg_arch.gif follows.
Text description of the illustration odg_arch.gif

1.4 Log Transport Services

The log transport services component of Oracle9i Data Guard controls the automated archival of archived redo logs from the primary site to one or more standby sites or destinations.

You can use log transport services to set up the following:

Log transport services provide control of different log archiving mechanisms, log archiving, error handling, reporting, and re-archiving logs after a system failure.

You set up a Data Guard configuration such that the databases are running on each site:

You create a standby database initially by copying the primary database. As redo log files are generated on the primary database, log transport services automatically archive them to each standby database. Log apply services apply the redo log files to each standby database. Log transport services and log apply services allow each standby database to be synchronized with the primary database with minimum latency.

You can customize log transport services for a variety of standby database configurations.

See Also:

Chapter 3, "Log Transport Services" 

1.5 Log Apply Services

Log apply services maintain the standby database in either a managed recovery mode or an open read-only mode. The managed recovery mode automatically maintains and applies archived redo logs to maintain transactional synchronization with the primary database, and allows transactionally consistent read-only access to the data.

In a Data Guard environment, the log apply services component coordinates its activities with the log transport services component.

See Also:

Chapter 4, "Log Apply Services" 

1.6 Role Management Services

Role management services provide the means to change database roles from a primary role to a standby role and back to a primary role. Database role transition includes database switchover and database switchback, as well as database failover.

Role management services operate in conjunction with the log transport services and log apply services to provide many options for the recovery of primary database modifications if the primary database is unavailable due to an unplanned shutdown. Role management services provide database failover options that may not require reinstantiation of other standby databases.

See Also:

Chapter 5, "Managing the Data Guard Environment" 

1.7 Physical Standby Process Architecture

The physical standby component of Oracle Data Guard uses several processes to achieve the automation necessary for disaster recovery and high availability.

On the primary site, log transport services use the following processes:

On the standby database, log apply services use the following processes:

Figure 1-3 identifies the relationships of these processes to the operations they perform and the database objects on which they operate.

Figure 1-3 Process Architecture


Text description of procarch.gif follows.
Text description of the illustration procarch.gif

1.8 Data Guard Environments

You can configure standby databases in a variety of ways in a Data Guard environment, including the following:

1.8.1 Typical Two-Site Data Guard Environment

A typical two-site Data Guard environment consists of a primary database and a standby database on a remote host connected by a network. Figure 1-4 shows a typical two-site Data Guard environment.

Figure 1-4 Typical Two-Site Data Guard Environment


Text description of before.gif follows.
Text description of the illustration before.gif

See Also:

Section 6.2 for detailed information on creating a standby database on a remote site 

1.8.2 Data Divergence and Data Loss

Data divergence is the temporary state of the primary database that occurs when a standby database becomes inaccessible. While in the data divergence state, the primary database is able to commit transactions whose data modifications are not immediately available on the standby database. Data divergence also occurs when you use the LGWR or ARCn process for asynchronous standby database archival operations.


Note:

Use the LGWR process in conjunction with synchronous standby database archival operations to prevent data divergence as long as continuous network connectivity is available. 


Data loss occurs when you fail over to a standby database whose corresponding primary database is in the data divergence state. To prevent primary database data divergence if network connectivity fails, use the guaranteed protection mode.


Note:

When you have multiple standby databases, the primary database may have diverged relative to one standby database, but not necessarily with other standby databases. Also, the degree of divergence may differ with each standby database. 


1.8.3 Primary Database Protection Modes Overview

The primary database protection modes are failure policies that dictate how to manage the primary database if a standby database becomes inaccessible. There are four primary database protection modes:

Guaranteed protection mode dictates that the primary database modifications must always be available on at least one standby database; data divergence is prohibited by terminating the primary instance if it loses network connectivity to the last standby database.

Instant protection mode dictates that the primary database modifications always be available on at least one standby database. Unlike guaranteed protection mode, data divergence is not prohibited by the instant protection mode. Data divergence exists for the duration that standby database connectivity is unavailable, and can be resolved when network connectivity to the primary database is reestablished.

Rapid protection mode indicates that primary database modifications are available to the standby database as soon as possible with minimal effect on primary database performance.

Delayed protection mode indicates that primary database modifications will ultimately be available on the standby site, as long as the network is active. Both the rapid and delayed protection modes allow the primary database to diverge from all standby databases, even when network connectivity is available. The degree of data divergence is equivalent to the data contained in the unarchived primary database online redo logs.

1.8.4 Standby Database No-Data-Loss Failover

On a standby database, no-data-loss failover is possible only when the corresponding primary database is operating in a data protection mode that provides no-data-divergence semantics, such as guaranteed and instant protection mode. This means that all primary database archived redo logs necessary for no-data-loss failover are available. However, it is possible that the archived redo logs have not yet been applied to the standby database. No-data-loss failover requires that all archived redo logs are first applied. If the archived redo logs are not applied, failover to a standby database will result in data loss relative to the primary database.

1.8.5 Standby Database Data-Loss Failover

Standby database data-loss failover occurs when primary database modifications have not all been applied, or when the corresponding primary database is operating in a data protection mode that allows data divergence semantics, such as rapid and delayed protection modes. This results in standby database data loss relative to the primary database. The amount of data loss can be controlled by primary database archived log destination attributes and the availability of standby redo logs at the standby database.

1.8.6 Primary Database Protection Modes Description

No data divergence means the primary database will not acknowledge primary database modifications until they have been confirmed as being available on at least one standby database. Data is protected when primary database modifications occur while there is connectivity to the standby database. Data is unprotected when primary database modifications occur while connectivity to the standby database is not available.

The primary and standby databases are synchronized by applying archived redo logs from the primary database to the standby database. Although the goal is to keep the databases identical, the transactions applied to the standby database can sometimes lag behind the primary database.

This lag may occur either because the data has not yet reached the standby site, or it may have reached the standby site, but has not yet been applied to the standby database.

If the data needed to keep the databases synchronized is not yet available on the standby site, and you must fail over, the contents of the databases will diverge, and some of the data will be lost. You can be protected from data loss by ensuring that all the data is available on the standby site. Data divergence will be eliminated once all of the data is ultimately applied.

The amount of primary database data divergence and standby database data loss can be controlled, depending on the level of protection required by your business. By weighing your requirements for availability against user demands for response time and performance, you can determine how tightly you want to synchronize the primary and standby databases and how much data you can afford to lose.

You can set up the primary database to achieve the following levels of data protection:

1.8.7 Data Divergence and Data Loss Summary

Table 1-1 summarizes the available data protection modes and their implications for primary database data divergence and standby database switchover and failover.

Table 1-1  Summary of Data Protection Modes
Primary Database Protection Mode Name  Database Protection Policy (Status)  Archived Log Destination Attributes (Dynamic)  Standby Network Connectivity (Runtime)  Resulting Primary Database Operating State  Standby Database Switchover Result  Standby Database Failover Result 

Guaranteed protection mode 

PROTECTED 

LGWR,
SYNC,
etc. 

Connected 

No data divergence 

No data loss 

No data loss 

Disconnected 

Instance shutdown 

Not possible 

No data loss 

Instant protection mode 

UNPROTECTED 

LGRW,
SYNC,
etc. 

Connected 

No data divergence 

No data loss 

No data loss 

Disconnected 

Delayed protection mode 

Not possible 

Data loss 

Rapid protection mode 

UNPROTECTED 

LGWR,
ASYNC,
etc. 

Connected 

Data divergence 

No data loss 

Data loss 

Disconnected 

Delayed protection mode 

Not possible 

Data loss 

Delayed protection mode 

UNPROTECTED 

ARCH 

Connected 

Data divergence 

No data loss 

Data loss 

Disconnected 

Data divergence 

Not possible 

Data loss 

1.8.8 Delayed Standby

By default, in managed recovery mode, the standby database automatically applies archived redo logs when they arrive from the primary database. But in some cases, you may want to delay applying the redo logs. A time lag can protect against the application of corrupted or erroneous data from the primary database to the standby database.

See Also:

Section 3.4.2.8 and Section 6.11 for detailed information on creating a standby database with a time lag 

1.9 Standby Database Operational Modes

You can use a standby database in several different ways, depending on the method for:

For example, in a Data Guard environment, log transport services automatically archive redo logs to the standby database site so long as the standby instance is started.

If the standby database is in managed recovery mode, the log apply services automatically apply logs received from the primary database. At any time you can open the standby database in read-only mode for reporting purposes.

You can operate a standby database in one of the following modes:

Although the standby database cannot be in more than one mode at the same time, you can change between the modes. For example, you can run in managed recovery mode and then open in read-only mode.

In most implementations of a Data Guard environment, you need to change between managed recovery mode and read-only mode at various times to either:

1.10 Database Roles

A database can be in one of two mutually exclusive roles: primary or standby. You can change these roles dynamically as a planned transition or as the result of a failure.

For example, a primary database can change to the standby role, so that its corresponding standby database can change to the primary role. This planned transition occurs without having to reinstantiate either database. This is known as a switchover operation.

In a failure of the primary database, such as a system or software failure, you may need to change the corresponding standby database to the primary role. This unplanned transition may result in the loss of application data. The potential loss of data is dependent on user-defined parameters of the primary database. This type of transition requires you to instantiate a new standby database from the newly activated primary database. This is known as a failover operation.

The active role of a database is more than conceptual; you must also consider physical aspects of the role. For example, a database in the primary role uses a current control file, while a database in the standby role uses a standby control file. Using different physical files, depending on which database role is active, requires careful coordination of the initialization parameter file.

1.11 Failover and Switchover

Failover is the operation of taking the primary database offline on one site and bringing one of the standby databases online. This operation occurs due to a system or software failure.

One of the consequences of failover is that the original primary database must be reinstantiated.

With Oracle9i, it is possible to switch over to a standby database without requiring a resetlogs operation. Switchover is the process of intentionally taking database resources offline on one system and bringing them back online on another system. For example, you might use switchover to perform a rolling upgrade (you switch over all of the database resources to one system as you sequentially upgrade hardware on the other system).

The main difference between a switchover process and a failover process is that switchover does not require reinstantiation of the database. This allows the primary database to resume its role as the standby database almost immediately. As a result, scheduled maintenance can be performed more frequently because it is less risky.

For many configurations, you can lessen the frequency of failures by a regular program of preventive maintenance tasks. The switchover capability allows you to schedule time for hardware and software chores such as the following, without interrupting processing:

Figure 1-5 depicts a failover operation from a primary database in San Francisco to a standby database in managed recovery mode in Boston.

Figure 1-5 Failover to a Standby Database


Text description of failover.gif follows.
Text description of the illustration failover.gif

After you fail over to the standby database, it ceases to be a standby database and becomes a fully functional primary database. At this point, you can open the database in read/write or read-only mode and make changes or issue queries as usual.


Caution:

Failing over to a standby database is a permanent operation. You cannot undo the failover and return the database to its former role as a standby database. 


1.11.1 Database Switchover

You can switch a database role from primary over to standby, and from standby back to primary without reinstantiating any of the databases.

Figure 1-6 depicts the environment after switchover.

Figure 1-6 Switchover to a Standby Database


Text description of switch.gif follows.
Text description of the illustration switch.gif

See Also:

Section 5.3 for information on switching database roles and Section 6.6 for detailed steps on how to perform a switchover operation 

1.11.2 Database Switchback

Once you have performed a database switchover operation, you can switch back to your original Data Guard configuration. A database switchback is performed using the switchover operation, but in the reverse direction. Figure 1-7 depicts the original environment after the switchback operation.

Figure 1-7 Data Guard Environment After Switchback


Text description of before.gif follows.
Text description of the illustration before.gif

1.12 Data Guard Interfaces

You can use the following to configure, implement, and manage a standby database:

1.13 Standby Database Creation

Once you have a primary database, you can create a standby database by using one of the following methods:


Go to previous page Go to next page
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback