Skip Headers
Oracle® Data Guard Broker
10g Release 2 (10.2)

Part Number B14230-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

5 Switchover and Failover Operations

This chapter describes how the broker manages databases during switchover and failover. This chapter contains the following sections:

5.1 Overview of Switchover and Failover in a Broker Environment

An Oracle database operates in one of two roles: primary or standby. Data Guard helps you change the role of a database using either a switchover or a failover:

Without the broker, you perform role transitions by first determining if a role transition is necessary and then issuing a series of SQL statements (as described in Oracle Data Guard Concepts and Administration). The broker simplifies switchovers and failovers by allowing you to invoke them using a single key click in Oracle Enterprise Manager or a single command in the DGMGRL command-line interface (referred to in this documentation as manual failover). Moreover, you can enable fast-start failover to fail over automatically when the primary database becomes unavailable. When fast-start failover is enabled, the broker determines if a failover is necessary and initiates the failover to the specified target standby database automatically, with no need for DBA intervention and with no loss of data.

Fast-start failover allows you to increase availability with less need for manual intervention, thereby reducing management costs. Manual failover gives you control over exactly when a failover occurs and to which target standby database. Regardless of the method you choose, the broker coordinates the role transition on all databases in the configuration.

When the database is opened for the first time after a role transition, the DB_ROLE_CHANGE system event fires. You can write a trigger that's associated with this system event to manage tasks after a role change occurs. See the table of system manager events in Oracle Database Application Developer's Guide - Fundamentals for more details.

5.2 Choosing a Target Standby Database

There are many factors to take into consideration when selecting a standby database to be the next primary database after a switchover or a failover. You need to consider all of the options at the time you are building your Data Guard configuration, including factors such as the characteristics of physical standby databases versus logical standby databases, the network latency to your standby database sites, the computing capabilities at a future primary database site, and so on.

For switchovers, understanding all of the factors can simplify the choice of which standby database to consider as your new primary database. In disaster situations where a failover is necessary, you may be more limited in which standby database is the best one to pick up the failed primary database's activities. The following sections provide guidelines to help you choose a target standby database.

Note:

For fast-start failover, you must pre-select the target standby database that will be used. Section 5.5 provides more information about fast-start failover.

5.2.1 Choosing a Target Standby Database for Switchover

When performing a switchover in a configuration whose standby databases are all of the same type (all physical or all logical standby databases), choose the standby database that has the least amount of unapplied redo. By choosing the standby database with the least amount of unapplied redo, you can minimize the overall time it takes to complete the switchover operation. For example:

  • Using DGMGRL, you can do this by examining the RecvQEntries monitorable property of each standby database in the configuration. For example, connect to one of the standby databases in the configuration and issue the SHOW DATABASE database_name RecvQEntries command. (When real-time apply is enabled and keeping up, this property will return no rows.)

  • Using Enterprise Manager, you can view the value of the ApplyLag column for each standby database in the Standby Databases section of the Data Guard Overview Page.

If the configuration contains both physical and logical standby databases, consider choosing a physical standby database (that has the least amount of unapplied redo) to be the target standby database. A switchover to a physical standby database is preferable because all databases in the configuration will be available as standby databases to the new primary database after the switchover operation completes. Whereas a switchover to a logical standby database will invalidate and disable the physical standby databases in the configuration. You will then need to reenable the physical standby databases from a backup of the new primary database before you can reenable them.

Note:

If the Data Guard configuration is running in maximum protection mode, the broker does not allow a switchover to occur to a logical standby database.

5.2.2 Choosing a Target Standby Database for Failover

When performing a failover in a configuration that contains all physical standby databases or all logical standby databases, choose the standby database that has the most data archived to it. By choosing the standby database that has the most amount of redo data archived to it, you can minimize the amount of data loss and in some cases, incur no data loss at all.

If the configuration contains both physical and logical standby databases, consider choosing a physical standby database as the target standby database. A failover to a physical standby database is preferable because it is likely that all standby databases in the configuration will still be available as standby databases to the new primary database after the failover operation completes. A failover to a logical standby database requires that all other standby databases be reenabled from a copy of the new primary database after the failover completes. In addition, a logical standby database may contain only a subset of the data present in the primary database. (For example, if the DBMS_LOGSTDBY.SKIP procedure was used to specify which database operations done on the primary database will not be applied to the logical standby database.)

However, there may be exceptions to the recommendation to choose a physical standby database as the target standby database. For example, if the physical standby database is lagging behind the logical standby database (the physical standby database was in read-only mode or running with a log apply delay via the DelayMins property) and your business requires minimum downtime, consider selecting the logical standby database as the failover target.

5.3 Switchover

You can switch a database from the primary role to the standby role, as well as from standby to primary. This is known as a database switchover, because the standby database that you specify becomes the primary database, and the original primary database becomes a standby database. There is no loss of data, the data is consistent between the original primary database and the new primary database after the switchover completes.

Whenever possible, you should switch over to a physical standby database:

5.3.1 Before You Perform a Switchover Operation

Consider the following points before you begin a switchover:

  • When you start a switchover, the broker verifies that at least one standby database, including the primary database that is about to be transitioned to the standby role, is configured to support the overall protection mode (maximum protection, maximum availability, or maximum performance).

  • Prepare the primary database in advance for its possible future role as a standby database in the context of the overall protection mode (see Section 4.6). Such preparation includes:

    • Ensuring that standby redo log files are configured on the primary database if you intend to use SYNC or ASYNC redo transport service to the database after the switchover.

    • Presetting redo transport services related properties, such as LogXptMode, NetTimeout, StandbyArchiveLocation, and AlternateLocation. For more details about managing redo transport services using configurable properties, see Section 4.4.

    • Presetting log apply services related properties, such as DelayMins and ApplyParallel. For more details about managing log apply services using configurable properties, see Section 4.5.

    • For each temporary table, verifying that temporary files associated with that table on the primary database also exist on the standby database. See Oracle Data Guard Concepts and Administration for more information about temporary files.

    Note that the broker does not use the properties to set up redo transport services and log apply services until you actually switch over the primary database to the standby role. Thus, the validity of the values of these properties is not verified until after the switchover. Once you set these properties, their values persist through role changes during switchover and failover.

  • If fast-start failover is enabled, a switchover can be performed only to the pre-specified target standby database and only if the standby database is synchronized with the primary database. For information about enabling fast-start failover and starting the observer, see Section 5.5.2.

After a switchover completes, the broker preserves the overall Data Guard protection mode as part of the switchover process by keeping the protection mode at the same protection level (maximum protection, maximum availability, or maximum performance) it was at before the switchover. Also, the network transmission mode (SYNC, ASYNC, or ARCH) for transporting redo to other standby databases not involved in the switchover does not change after a switchover. Log apply services on all other standby databases not involved in the switchover automatically begin applying archived redo log files from the new primary database.

If there are both logical and physical standby databases in the configuration and the switchover occurs to a logical standby database, you need to reenable all physical standby databases, as described in Section 5.4.3.

5.3.2 Starting a Switchover

The act of switching roles should be a well-planned activity. The primary and standby databases involved in the switchover should have as small a transactional lag as possible. Oracle Data Guard Concepts and Administration provides information about setting up the databases in preparation of a switchover.

To start a switchover using Enterprise Manager, select the standby database that you want to change to the primary role and click Switchover. When using DGMGRL, you need to issue only one SWITCHOVER command to specify the name of the standby database that you want to change into the primary role.

The broker controls the rest of the switchover, as described in Section 5.3.3.

5.3.3 How the Broker Performs a Switchover

Once you start the switchover, the broker:

  1. Verifies that the primary and the target standby databases are in the following states:

    1. The primary database is enabled and is in the ONLINE state.

    2. The participating standby database is enabled and is in the ONLINE state.

    The broker allows the switchover to proceed as long as there are no errors for the primary database and the standby database that you selected to participate in the switchover operation. Errors occurring for any other standby databases not involved in the switchover will not impede the switchover.

  2. Shuts down all instances except one.

    If the primary database is a RAC database, the broker keeps only one instance running and shuts down all other instances before it continues the switchover. If the standby database you want to switch to the primary role is a RAC database, the broker shuts down all instances except the apply instance before it continues the switchover. If those other instances cannot be shut down, the switchover fails. In this case, you must manually shut down those other instances and issue the switchover command again. It is also important that you do not start any new instances during the switchover. If you must manually shut down the instances on the standby database, do not shut down the apply instance.

  3. Switches roles between the primary and standby databases.

    The broker first converts the original primary database to run in the standby role. Then, the broker transitions the target standby database to the primary role. If any errors occur during either conversion, the broker stops the switchover. See Section 10.3, "Troubleshooting Problems During a Switchover Operation" for more information.

  4. Updates the broker configuration file to record the change in roles.

    Because the configuration file profiles all database objects in the configuration, this ensures that each database will run in the correct role should it be restarted later for any reason.

  5. Restarts the new standby (former primary) database if the switchover occurs with a physical standby database, and Redo Apply begins applying redo data from the new primary database. If this is a RAC database, the broker restarts the instances that it shut down prior to the switchover.

  6. Restarts the new primary database if it was a physical standby database, opens it in read/write mode, and starts redo transport services transmitting redo data to the standby databases, including to the former primary database. If the switchover occurs to a logical standby database, there is no need to restart any databases. If this is a RAC database, the broker restarts the instances that it shut down prior to the switchover.

The broker verifies the state and status of the databases to ensure that the switchover transitioned the databases to their new role correctly. Standby databases not involved in the switchover and not disabled by the broker after the switchover will continue operating in the state they were in before the switchover. For example, if a physical standby database was in read-only mode, it will remain in that mode after switchover completes. Redo Apply and SQL Apply on all other standby databases not involved in the switchover automatically begin applying archived redo log files from the new primary database.

5.4 Manual Failover

You can convert a standby database to a primary database when the original primary database fails and there is no possibility of recovering the primary database in a timely manner. This is known as a manual failover. There may or may not be data loss depending upon whether your primary and target standby databases were transactionally consistent at the time of the primary database failure. The word manual is used to contrast this type of failover with a fast-start failover (described in Section 5.5).

Note:

You can perform a manual failover even if fast-start failover is enabled. See Section 5.5.2.4 for more information.

The following sections describe how to perform manual failovers:

5.4.1 Complete and Immediate Manual Failovers

Using Enterprise Manager or DGMGRL, you can perform either a complete (recommended) or an immediate failover:

  • A complete failover is the recommended and default failover option. It automatically recovers the maximum amount of data for the protection mode of the original primary database application data. A complete failover also attempts to bring along any standby databases not involved in the failover, to continue serving as standby databases to the new primary database.

    The behavior of a complete failover varies depending on the type of standby database being used:

    • After failover to a physical standby database, the original primary database must be reenabled to act as a standby database for the new primary database. In addition, some standby databases may be disabled by the broker during the failover if the broker detects that they have applied redo beyond where the new primary database had applied. Any database that was disabled by the broker must be reenabled using the steps described in Section 5.4.3.

    • After failover to a logical standby database, the original primary database and all standby databases in the configuration (that were not the target of the failover) will be disabled and must be reenabled to act as standby databases for the new primary database. Any database that was disabled by the broker must be reenabled using the steps described in Section 5.4.3.

    During a complete failover, the broker controls the failover steps described in Section 5.4.2.1.

  • An immediate failover is the fastest type of failover. However, no additional data is applied on the standby database once you invoke the failover. Another consequence of immediate failover is that you must also reenable the original primary database and all other standby databases not involved in the failover before they can serve as standby databases to the new primary database. Section 5.4.3 describes how to do this. During an immediate failover, the broker controls the failover steps described in Section 5.4.2.2.

    Caution:

    Always try to perform a complete failover first. Only when a complete failover is unsuccessful should you perform an immediate failover. Depending on the destination attributes of redo transport services, a complete failover can occur without any data loss, while an immediate failover usually results in data loss.

5.4.2 Performing a Manual Failover Operation

After determining that there is no possibility of recovering the primary database in a timely manner, ensure that the primary database is shut down and then begin the failover operation.

The steps in this section describe how to perform a manual failover. Depending on the failover and the types of standby databases involved, some of the databases may need to be restarted or reenabled. The instructions guide you through the appropriate steps for each type of situation.


Step 1   Determine which of the available standby databases is the best target for the failover.

Follow the guidelines described in Section 5.2, "Choosing a Target Standby Database".

Step 2   Start the failover.

Using Enterprise Manager or DGMGRL, perform either a complete (recommended) or an immediate failover.

Manual Failover Using Enterprise Manager:

On the Data Guard Overview Page in Enterprise Manager, select the standby database that you want to change to the primary role and click Failover. Then, on the Failover Confirmation Page, click Yes to invoke the default Complete failover option.

Manual Failover Using DGMGRL:

On the target standby database, issue the FAILOVER command to invoke a complete failover, specifying the name of the standby database that you want to change into the primary role:

DGMGRL> FAILOVER TO database-name;

See Also:

"Scenario 8: Performing a Manual Failover Operation" in Chapter 7 and the reference information for the FAILOVER command in Chapter 8

If the target standby database is a RAC database, the broker will shut down all instances except the apply instance before it continues the failover. If the broker cannot shut down the instances, the failover fails. In this case, you must manually shut down all instances except the apply instance and issue the FAILOVER command again. It is also important that you do not start any new instances during the failover. The broker restarts instances that it shut down prior to the failover.

Step 3   Reset the protection mode.

After a manual failover (complete or immediate), the overall Data Guard protection mode is handled as follows:

  • If the protection mode was at maximum protection, it is reset to maximum performance. You can upgrade the protection mode later, if necessary, as described in Section 4.6.1.

  • If the protection mode was at maximum availability, it remains at maximum availability.

Note:

If you perform a manual failover when fast-start failover is enabled:
  • The failover can only be performed to the pre-selected target standby database.

  • The broker preserves the protection mode at the maximum availability level (which is the mode it was operating in before the failover occurred).

Redo transport settings (SYNC, ASYNC, or ARCH) on standby databases other than the target standby database do not change.

Step 4   Re-establish a disaster-recovery configuration.

To maintain a viable disaster-recovery solution in the event of another disaster, you may need to perform the additional steps described in Section 5.4.3 to:

  • Reinstate the original primary database to act as a standby database in the new configuration.

  • Flash back (or reinstate) standby databases in the configuration that were disabled by the broker.

    After a complete failover finishes, any standby database not involved in the failover that is not viable as a standby for the new primary database will be disabled by the broker. This can happen for either of these reasons:

    • The broker detects that the standby database has applied redo data beyond what has been applied on the new primary database.

      For instance, this could happen if a standby database not involved in the failover has applied more log files than the new primary database itself has applied. The standby database must be reenabled or flashed back before it can serve as a standby for the new primary database.

    • The failover was to a logical standby database, the broker disables all of the (physical and logical) standby databases in the configuration that were not involved in the failover. They must be reenabled before they can serve as standby to the new primary database.

5.4.2.1 How the Broker Performs a Complete Failover Operation

Once you start a complete failover, the broker:

  1. Checks to see if the primary database is still available and, if so, issues a warning message asking whether you want to continue with the failover operation. If you are using Enterprise Manager and choose to continue, the primary database is shut down.

  2. Verifies that the target standby database is enabled. If the database is not enabled, you will not be able to perform a failover to this database. If the target is a RAC standby database, the broker shuts down all instances except the apply instance.

  3. Waits for the target standby database to finish applying any remaining archived redo log files before stopping Redo Apply or SQL Apply.

  4. Transitions the target standby database into the primary database role, as follows:

    1. Opens the new primary database in read/write mode.

    2. Determines whether or not any standby databases that did not participate in the failover operation have applied redo data beyond the new primary database, and thus need to be reenabled.

      If a standby database not involved in the failover is not disabled by the broker during this failover, it will remain in the state it was in before the failover. For example, if a physical standby database was operating in read-only mode, it will remain in read-only mode.

    3. Starts redo transport services to begin transmitting redo data to all standby databases not involved in the failover and not required to be reenabled.

    Note:

    Standby databases not directly involved in a failover may be disabled by the broker during the failover, and they must be reenabled in the configuration before they can serve as standby databases to the new primary database. If there is more than one standby database in the configuration, Oracle recommends configuring Flashback Database on every database so that if failover occurs to a physical standby database, you can more easily reinstate any disabled physical standby databases. However, if failover occurs to a logical standby database, all (physical and logical) standby databases will be disabled by the broker. In this case, Flashback Database cannot be used to reinstate databases.

    To use Flashback Database, you must configure it on every database in the configuration. Then, after a failover occurs, you can use Flashback Database to reinstate your disabled physical standby database.

  5. If the target is a RAC standby database, the broker restarts instances that it shut down prior to the failover.

The broker allows the failover to proceed as long as there are no errors for the standby database that you selected to participate in the failover. Errors occurring for any standby databases not involved in the failover will not stop the failover. If you initiated a complete failover and it fails, you might need to retry the failover as an immediate failover.

5.4.2.2 How the Broker Performs an Immediate Failover Operation

Once you start an immediate failover, the broker:

  1. Verifies that the target standby database is enabled. If the standby database is not enabled for management by the broker, then the failover cannot occur.

  2. Stops Redo Apply or SQL Apply on the standby database immediately, without waiting until all available redo data has been applied. This may result in data loss.

  3. Transitions the target standby database into the primary role, opens the new primary database in read/write mode, and starts redo transport services.

    After an immediate failover completes to a physical standby database, all the standby databases in the configuration, regardless of their type, are disabled. They must be reenabled before they can serve as standby database to the new primary database. See Section 5.4.3 for information.

The broker allows the failover to proceed as long as there are no errors for the standby database that you selected to participate in the failover.

5.4.3 Reenabling Disabled Databases After Failover or Switchover

To restore your original disaster-recovery solution after switchover to a logical standby database or after failover to any standby database, you may need to perform additional steps.

Note:

After switchover to a physical standby database, no additional action is required. The standby databases not involved in the switchover continue to operate in the state they were in before the switchover occurred and will automatically begin applying redo data received from the new primary database.

Databases that have been disabled after a role transition are not removed from the broker configuration, but they are disabled in the sense that the databases are no longer managed by the broker.

To reenable broker management of these databases, you must reinstate or re-create the databases using one of the following procedures:

  • If a database can be reinstated, the database will show the following status after a complete failover:

    ORA-16661: the standby database needs to be reinstated
    
    

    Reinstate the database using the DGMGRL REINSTATE DATABASE command or the reinstate option in Enterprise Manager, as described in Section 5.4.3.1, "How to Reinstate a Database".

  • If a database must be re-created from a copy of the new primary database, it will have the following status:

    ORA-16795: the broker detects that database re-creation is required
    
    

    Re-create the standby database from a copy of the primary database and then reenable it. The procedures for creating a standby database are documented in Oracle Data Guard Concepts and Administration. See Section 5.4.3.2, "How to Re-create and Reenable a Disabled Database" for more information.

Note:

Any database that was disabled through multiple role changes cannot be reinstated. You must re-create the database manually and then reenable the database in the broker configuration.

Whether you reinstate or re-create a database depends on if you performed a switchover or failover and on the type of standby database that was the target of the operation.

The following table describes how to reenable disabled databases based on the type of role transition that was performed. The status value associated with databases that are disabled after a switchover or failover will also guide you in choosing which procedure to use. These status values can be viewed in the output from the DGMGRL SHOW DATABASE or on the Data Guard Overview page in Enterprise Manager.

Table 5-1 Reenabling Disabled Databases After Failover or Switchover

Role Transition (Switchover or Failover) Reinstate or Re-create a Failed Primary Database Reenabling the Standby Databases Not Involved in the Role Transition

Switchover to a physical standby database

No action is required.

No action is required.

Switchover to a logical standby database

No action is required.

All physical standby databases will be disabled and must be re-created from a copy of the new primary database. Logical standby databases will not be disabled.

Complete failover to a physical standby database

The broker disables the failed primary database during the failover operation. You can reinstate the database if Flashback Database was enabled prior to the failover and there are sufficient flashback logs on the failed primary database.

Otherwise, you must re-create the primary database from a copy of the new primary database.

Physical standby databases that were disabled during failover can be reinstated if Flashback Database was enabled prior to failover and there are sufficient flashback logs on the physical standby database. Otherwise, the physical standby databases must be re-created from a copy of the new primary database.

Logical standby databases disabled during failover must be re-created from a copy of the new primary database.

Complete failover to a logical standby database

The broker disables the failed primary database during the failover. You can reinstate the database if Flashback Database was enabled prior to failover and there are sufficient flashback logs on the failed primary database.

Otherwise, re-create the primary database from a copy of the new primary database.

The broker disables all standby databases not involved in the failover. You must re-create the databases from a copy of the new primary database.

Immediate failover to either a physical or logical standby database

The broker disables the failed primary database during failover. You must re-create the database from a copy of the new primary database.

The broker disables all standby databases not involved in the failover. You must re-create the databases from a copy of the new primary database.


The following sections describe how to reinstate or reenable a database.

5.4.3.1 How to Reinstate a Database

You can use the broker's REINSTATE command to reenable the failed primary database after performing a complete failover to either a physical or logical standby database. You can also use the broker's REINSTATE command to reenable any physical standby databases that were not the target of the failover operation but were disabled during a complete failover to a physical standby database.

Databases that can be reinstated will have the following status value:

ORA-16661: the standby database needs to be reinstated

For the REINSTATE command to succeed, Flashback Database must have been enabled on the database prior to the failover and there must be sufficient flashback logs on that database. In addition, the database to be reinstated and the new primary database must have network connectivity.

To reinstate a database:

  1. Restart the database to the mounted state

  2. Connect to the new primary database

  3. Use Enterprise Manager or DGMGRL to reinstate the database

When reinstating a failed primary database, the broker reenables it as a standby database of the same type (physical or logical standby database) as the old standby database. When reinstating physical standby databases that were disabled during a failover, the broker reenables them as physical standby databases to the new primary database.

Reinstatement Using Enterprise Manager

On the Data Guard Overview page, click the Database must be reinstated link. This brings up the General Properties page that provides a Reinstate button. After you click the Reinstate button, Enterprise Manager begins reinstating the database.

When the process is complete, the database will be enabled as a standby database to the new primary database, and Enterprise Manager displays the Data Guard Overview page.

Reinstatement Using DGMGRL

Issue the following command while connected to any database in the broker configuration, except the database that is to be reinstated:

DGMGRL> REINSTATE DATABASE db_unique_name;

The newly reinstated standby database will begin serving as standby database to the new primary database. If the database is not reinstated successfully, then you must reenable it from a copy of the new primary database, as described in Section 5.4.3.2.

5.4.3.2 How to Re-create and Reenable a Disabled Database

If you performed a failover or switchover that requires you to re-create the failed primary database or standby databases that were disabled during the role transition, follow the procedures in Oracle Data Guard Concepts and Administration.

After the database has been re-created, enable broker management of the re-created standby database by using the DGMGRL ENABLE DATABASE command.

5.5 Fast-Start Failover

Fast-start failover allows the broker to automatically fail over to a previously chosen, synchronized standby database in the event of loss of the primary database. Fast-start failover quickly and reliably fails over the target standby database to the primary database role, without requiring you to perform any manual steps to invoke the failover. Fast-start failover can be used only in a broker configuration and can be configured only through DGMGRL or Enterprise Manager.

This section describes how to enable fast-start failover and an observer site that monitors the fast-start failover environment. The observer is a separate OCI client-side component that runs on a different computer from the primary and standby databases and monitors the availability of the primary database. The observer is described in more detail in Section 5.5.6.

Once the observer is enabled, no further user interaction is required. If both the observer and the standby database lose connectivity to the primary database, the observer waits for the amount of time specified by the FastStartFailoverThreshold property before initiating a fast-start failover. Moreover, after the failover completes, the former primary database is automatically reinstated as a standby database in the new broker configuration when a connection to it is reestablished.

Figure 5-1 shows the relationships between the primary database, target standby database, and the observer during fast-start failover:

Figure 5-1 Relationship of Primary and Standby Databases and the Observer

Description of Figure 5-1 follows
Description of "Figure 5-1 Relationship of Primary and Standby Databases and the Observer"

The following sections describe these topics:

5.5.1 Prerequisites for Enabling Fast-Start Failover

The following prerequisites must be met before the broker allows you to enable fast-start failover:

  • Ensure the broker configuration is running in maximum availability mode.

    See Section 4.6.1 for information about configuring the protection mode, standby redo logs, and the LogXptMode property.

  • Enable Flashback Database and set up a flash recovery area on both the primary database and the target standby database.

    See Oracle Database Backup and Recovery Advanced User's Guide) and "Setting Up Flash Recovery Areas as Destinations" in Oracle Data Guard Concepts and Administration.

  • Install the DGMGRL command-line interface on the observer computer as described in Section 2.1.

  • Configure the TNSNAMES.ORA file on the observer system so that the observer is able to connect to the primary database and the pre-selected target standby database.

5.5.2 Enabling Fast-Start Failover

You can enable fast-start failover from any site, including the observer site, while connected to any database in the broker configuration. Enabling fast-start failover does not trigger a failover. Instead, it allows the observer to begin observing the primary and standby databases and initiate a fast-start failover should conditions warrant a failover.

Perform the following steps to enable fast-start failover and start the observer. The steps assume that you are connected as SYS and that a primary and standby database are already set up in a broker configuration.


Step 1   Determine which of the available standby databases is the best target for the failover.

Follow the guidelines described in Section 5.2, "Choosing a Target Standby Database".

Step 2   Specify the target standby database with the FastStartFailoverTarget property.

When configuring fast-start failover, the FastStartFailoverTarget property on the current primary database, you can specify only one standby database:

  • If there is only one standby database in the configuration, you can skip this step and continue with Step 3. The broker will automatically set the FastStartFailoverTarget property on the primary and standby databases to point to each other as their respective target during a failover.

  • If there is more than one standby database in the configuration, you must explicitly set the FastStartFailoverTarget property on the primary database and target standby database to point to each other for the purpose of defining which standby database will be the target of a fast-start failover. For example:

    DGMGRL> EDIT DATABASE 'North_Sales' SET PROPERTY FastStartFailoverTarget = 'DR_Sales';
    DGMGRL> EDIT DATABASE 'DR_Sales' SET PROPERTY FastStartFailoverTarget = 'North_Sales';
    
    

    In this example, the current primary database, North_Sales, specifies DR_Sales as its failover target, and the target standby database, DR_Sales, specifies the current primary database as its target. When DR_Sales becomes the primary database it must have a standby target to which it can fail over.

    Note:

    To change the FastStartFailoverTarget property to point to a different standby database, disable fast-start failover, set the FastStartFailoverTarget property, and restart fast-start failover.

See Section 9.2.9, "FastStartFailoverTarget" for more information about this property.

Step 3   Set the FastStartFailoverThreshold property.

Fast-start failover will occur if both the observer and the target standby database lose connection to the primary database for the period of time specified by the FastStartFailoverThreshold property.

Set the FastStartFailoverThreshold property to specify the number of seconds you want the observer and target standby database to wait (after detecting the primary database is unavailable) before initiating a failover. For example:

DGMGRL> EDIT CONFIGURATION SET PROPERTY FastStartFailoverThreshold = 45;

This is a configuration-level property and the setting of this property holds for the duration that fast-start failover is enabled. The default value for the FastStartFailoverThreshold property is 30 seconds. If you have a RAC primary database, consider specifying a higher value to minimize the possibility of a false failover in the event of an instance failure.

The time interval starts when the observer first loses its connection to the primary database. If the observer is unable to regain a connection to the primary database within the specified time, then the observer begins a fast-start failover provided the standby database is ready to fail over. Although the default value of 30 seconds is typically adequate for detecting outages and failures on most configurations, you can adjust failover sensitivity with this property to decrease the probability of false failovers in a temporarily unstable environment.

See Also:

Section 9.2.10 for reference information about the FastStartFailoverThreshold property

Step 4   Enable fast-start failover.

Use Enterprise Manager Fast-Start Failover wizard or the DGMGRL ENABLE FAST_START FAILOVER command to enable fast-start failover. To enable fast-start failover, both the primary and target standby databases must be running and have connectivity, and satisfy all of the prerequisite conditions listed in Section 5.5.1.

Enable Fast-Start Failover Using Enterprise Manager

To enable fast-start failover in Enterprise Manager, use the Fast-Start Failover wizard. On the Data Guard Overview Page next to the "Fast-Start Failover" status field, click Disabled to invoke the Fast-Start Failover Page. Then, on the Fast-Start Failover Change Mode Page, click Enabled. The broker will start the observer and change the configuration's protection mode to maximum availability, if necessary. Then, on the Fast-Start Failover Configure Page, select the standby database that should be the target of a failover. See Section 5.2, "Choosing a Target Standby Database" for helpful advice.

  1. See Also:

    Section 6.4, "Scenario 4: Enabling Fast-Start Failover and the Observer" for an example of the fast-start failover wizard

Enable Fast-Start Failover Using DGMGRL

To enable fast-start failover with DGMGRL, issue the ENABLE FAST_START FAILOVER command while connected to any database system in the broker configuration, including on the observer computer. For example:

DGMGRL> ENABLE FAST_START FAILOVER;
Enabled.

If there is only one standby database in the broker configuration, the broker will automatically set the FastStartFailoverTarget property for both the primary and standby databases when fast-start failover is enabled.

Note:

Administration at the target standby site should be as comprehensive as that at the primary site because the standby database may assume the primary role without prior notice. Staff support, hardware and software, security (both software and site), network connections, and bandwidth should be equivalent at both sites.

Step 5   Start the Observer.

To start the observer, only the primary database must be running; it is not necessary for the target standby database to be running.

You can start the observer before or after you enable fast-start failover. However, it is recommended that you have the observer running whenever you have fast-start failover enabled. If fast-start failover is enabled, the observer immediately begins monitoring the status and connections to the primary and target standby databases.

Starting the Observer Using Enterprise Manager

If the Enterprise Manager agent is installed on the observer computer, it automatically starts the observer when you enable fast-start failover through Enterprise Manager. If the agent is not present, you must start the observer manually using the following instructions for the DGMGRL command-line interface.

Starting the Observer Using DGMGRL

To start the observer with DGMGRL, issue the following command on the observer computer:

DGMGRL> START OBSERVER;

The observer is a continuous, foreground process; thus, the command-line prompt on the observer computer does not return until you issue the STOP OBSERVER command from another DGMGRL session. To issue commands and interact with the broker configuration, you must connect through another DGMGRL client session.

See the START OBSERVER command for more information.

Step 6   Verify the fast-start failover environment.

To verify the readiness of the fast-start failover configuration, issue the DGMGRL SHOW CONFIGURATION VERBOSE command on the primary database. For example:

DGMGRL> SHOW CONFIGURATION VERBOSE;

Configuration
 Name:                DRSolution
 Enabled:             YES
 Protection Mode:     MaxAvailability
 Fast-Start Failover: ENABLED
 Databases:
   North_Sales - Primary database
   DR_Sales    - Physical standby database
               - Fast-Start Failover target
Fast-Start Failover
 Threshold: 45 seconds
 Observer:  observer.foo.com
Current status for "DRSolution":
SUCCESS 

The following sections provide more information about the fast-start failover environment:

5.5.2.1 What Happens When Fast-Start Failover and the Observer Are Running?

Once you enable fast-start failover and start the observer, the observer continuously monitors the environment to ensure the primary database is available. This section lists the steps the observer takes to determine if fast-start failover is needed and then performs one, if necessary.


Step 1   Monitor the environment to ensure the primary database is available.

The following list describes some of the conditions with the primary database, system, or site that could cause the observer to attempt a fast-start failover:

  • Broken network connection between the observer and the primary database

    If the connection is lost between the observer and the primary database, or there are network failures that cause the primary database to be isolated, the observer attempts a fast-start failover.

  • Instance failures

    If a single-instance primary database (either RAC or nonRAC), or if all instances of a RAC primary database fail, the observer attempts a fast-start failover.

  • Shutdown abort

    If a single-instance primary database (either RAC or nonRAC), or if all instances of a RAC primary database are shut down with the ABORT option, the observer attempts a fast-start failover. Fast-start failover will not be attempted for the other types of database shutdown (NORMAL, IMMEDIATE, TRANSACTIONAL).

  • Offline datafiles

    If the observer determines that one or more datafiles in the primary database have been taken offline by the database because of I/O errors, the observer attempts a fast-start failover.

Except for the last condition (Offline datafiles), the observer attempts to reconnect to the primary database within the time specified by the FastStartFailoverThreshold configuration property before attempting a fast-start failover. When the primary database datafiles are offline, the observer initiates a fast-start failover immediately, without waiting for the amount of time specified by the FastStartFailoverThreshold property to expire.

Step 2   Reconnect within the time specified by FastStartFailoverThreshold.

If the observer detects a problem, the observer attempts to reconnect to the primary database within the time specified by the FastStartFailoverThreshold property. The FastStartFailoverThreshold time interval starts when the observer first detects there might be a failure with the primary database.

If the primary database is a Real Application Clusters (RAC) database, the observer will attempt to connect to the remaining primary instances. Fast-start failover will not occur unless all instances comprising the RAC primary database are perceived to have failed.

Note:

If the observer determines that the data files on the primary database are offline but the primary system is running, fast-start failover is initiated immediately without waiting for the FastStartFailoverThreshold interval to expire.

Step 3   Verify the target standby database is ready for failover.

If the primary database is still unavailable when the FastStartFailoverThreshold expires, the observer verifies the target standby database is ready to fail over to the primary database role.

Fast-start failover cannot occur if:

  • Fast-start failover is no longer enabled

  • The observer cannot connect to the target standby database

    See Also:

    Section 5.5.6.3, "What Happens if the Observer Fails?" if the observer is not running
  • The observer and the target standby database are inconsistent with regard to the current state of the broker configuration

  • The observer was stopped, and when it restarted, only the standby database was available

  • The target standby database was not synchronized with the primary database at the time the primary database failed

  • The target standby database, if it is a logical standby database, is still loading its copy of the former primary database's dictionary (in this case the FS_FAILOVER_STATUS column in the V$DATABASE view contains LOADING DICTIONARY instead of READY)

  • The network connection exists between the target standby database and the primary database

  • The FS_FAILOVER_STATUS column in the V$DATABASE view for the target standby database displays a reason why fast-start failover cannot occur

  • A manual failover is already in progress. See Section 5.4 for complete information about manual failovers.

  • The primary database was shut down intentionally, in a controlled fashion

Step 4   Initiate a fast-start failover.

If the target standby database is ready for failover, the observer immediately invokes a fast-start failover. The observer will fail over the target standby database to the primary database role. If failover is not possible for some reason, the observer will try again to connect to the primary database indefinitely.

Step 5   Reinstate the former primary database as a new standby database.

After the fast-start failover completes successfully, the observer will attempt to reinstate the former primary database as a new standby database when a connection to the former primary database is reestablished.

See Also:

Section 5.5.7 for more information about reinstatement

5.5.2.2 Restrictions When Fast-Start Failover is Enabled

When fast-start failover is enabled, you cannot:

  • Change:

    • The configuration protection mode to either maximum protection or maximum performance

    • The LogXptMode property on the primary or target standby databases

    • The FastStartFailoverTarget property on the primary or target standby databases

  • Disable or delete:

    • The broker configuration

    • The standby database that is the target of fast-start failover

  • Perform a manual failover:

    • Unless the conditions listed in Section 5.5.2.4 have been met

    • To a standby database that is not configured as the fast-start failover target

    • To a standby database that is not synchronized with the primary database, even if it is configured as the target standby database

      To determine if the configuration is ready for fast-start failover to occur, issue the DGMGRL SHOW CONFIGURATION command (as shown in Section 5.5.3), or query the V$DATABASE view on either the primary and target standby databases. Fast-start failover is possible if the FS_FAILOVER_STATUS column displays SYNCHRONIZED value and the FS_FAILOVER_OBSERVER_PRESENT column displays YES for the target standby database.

  • Perform a switchover to the target standby database unless the standby database is synchronized with the primary database and the observer is running

  • Attempt to open the primary database from another Oracle client (for example, with the SQL*Plus SQL> STARTUP command). Doing so will result in the following error begin returned:

    ORA-16649: database will open after Data Guard broker has evaluated Fast-Start Failover status 
    
    

    This error occurs because, when fast-start failover is enabled, the broker must perform additional validity checks before allowing the database to open and allowing transactions to commit.

5.5.2.3 Shutting Down the Primary Database When Fast-Start Failover Is Enabled

Fast-start failover will not be triggered if the primary or standby database is shut down normally (using SHUTDOWN NORMAL, SHUTDOWN IMMEDIATE, or SHUTDOWN TRANSACTIONAL). A normal shutdown will prevent fast-start failover until the primary database and standby database are connected and communicating again.

5.5.2.4 Performing Manual Role Changes When Fast-Start Failover Is Enabled

If fast-start failover is enabled you can still perform a switchover or a manual failover as long as the following conditions are met:

  • The role change is directed to the same standby database that was specified with the FastStartFailoverTarget property

  • The target standby database is synchronized with the primary database

  • For manual failover, the observer is started and communicating with the target standby database

See Also:

Section 5.3 and Section 5.4 for more information about switchovers and manual failovers, respectively

5.5.3 Viewing Fast-Start Failover Configuration Statistics and Status

You can query the V$DATABASE view to verify the observer is started and the configuration is ready for fast-start failover. For example, to verify the observer is started and the configuration is ready for fast-start failover, query the V$DATABASE view on the target standby database or issue the SHOW CONFIGURATION VERBOSE command.

The following example shows the fast-start failover information for the DRSolution configuration:

DGMGRL> SHOW CONFIGURATION VERBOSE;
Configuration
 Name:                DRSolution
 Enabled:             YES Protection Mode:     MaxAvailability
 Fast-Start Failover: ENABLED
 Databases:
   North_Sales - Primary database
   DR_Sales    - Physical standby database
               - Fast-Start Failover target
Fast-Start Failover
 Threshold: 45 seconds
 Observer:  observer.foo.com

Current status for "DRSolution":
SUCCESS 

When querying the V$DATABASE view, pay special attention to the FS_FAILOVER_STATUS column that can contain the values described in Table 5-2:

Table 5-2 FS_FAILOVER_STATUS Column of the V$DATABASE View

Column Value Description Fast-Start Failover ...

DISABLED

Fast-start failover is disabled.

Is not possible

BYSTANDER

Fast-start failover is enabled, but this standby database is not the target of the fast-start failover. The database cannot provide fast-start failover status information.

Is enabled

SYNCHRONIZED

The primary and target standby databases are synchronized.

Is possible if the target standby database displays SYNCHRONIZED and the FS_FAILOVER_OBSERVER_PRESENT column displays YES

UNSYNCHRONIZED

The target standby database does not have all of the primary database redo data.

Is not possible

LOADING DICTIONARY

Displays only on a logical standby database that has not yet completed loading a copy of the primary database's data dictionary.

Is not possible

SUSPENDED

Displays only on the target standby database when either the primary or target standby database was shut down in a controlled fashion (using the NORMAL, IMMEDIATE, or TRANSACTIONAL, options, but not the ABORT option). Fast-start failover is inhibited in the SUSPENDED state. It is cleared upon reconnection to the primary database.

Is not possible

STALLED

Displays on the primary database after loss of connectivity to the target standby database and the change to the UNSYNCHRONIZED state cannot be confirmed by either the target standby database or the observer.

It stalls because it is likely a failover has occurred. Note: this state also occurs during startup when fast-start failover is synchronized and neither the target standby database nor the observer are present to confirm it is okay to continue opening the database.

The primary database will not stall upon loss of connectivity to the target standby database if both the primary and standby databases lost connectivity to the observer more than a minute in the past. Fast-start failover is not possible in this case to allow the primary database to continue committing redo even though neither the target standby database nor the observer are present.

Is possible

PRIMARY UNOBSERVED

Displays only on the target standby database when it is SYNCHRONIZED with the primary database, has connectivity to the observer, but the primary database does not have a connection to the observer. This is a rare state.

Is not possible

REINSTATE REQUIRED

The failed primary database requires reinstatement as a new standby database to the new primary. The observer automatically starts the reinstatement process. REINSTATE REQUIRED is present only after fast-start failover has occurred and shows only on the new primary database.

Has completed

REINSTATE IN PROGRESS

Reinstatement of the failed primary database as a new standby database is in progress.

Has completed

REINSTATE FAILED

Reinstatement of the failed primary database as a new standby database failed. See Section 10.1 for details about the broker's drc* log files.

Has completed


5.5.4 Disabling Fast-Start Failover

Disabling fast-start failover prevents the observer from initiating a failover to the target standby database. In this case, manual failover may still be possible. See Section 5.4 for information about manual failover.

Note:

Disabling fast-start failover does not stop the observer. To stop the observer, see Section 5.5.6.4, "Stopping the Observer".

To disable fast-start failover, use the Fast-Start Failover wizard in Enterprise Manager or the DGMGRL DISABLE FAST_START FAILOVER [FORCE] command. The FORCE option disables fast-start failover on the database to which you are connected even when errors occur. Whether or not you use the FORCE option depends on if the primary and target standby database have network connectivity:

  • If the primary and target standby database have network connectivity, Oracle recommends that you use DISABLE FAST_START FAILOVER without the FORCE option. This method will disable fast-start failover on all databases in the broker configuration.

    If errors occur during the disable operation, the broker returns an error message and stops the disable operation.

  • If the primary and target standby databases do not have network connectivity or if the database to which you are connected does not have network connectivity with the primary database, consider using DISABLE FAST_START FAILOVER with the FORCE option.

    The broker may not be able to disable fast-start failover on all databases in the broker configuration when you issue the DISABLE FAST_START FAILOVER FORCE command. As a result, there is no guarantee that the observer will not perform a fast-start failover to the target standby database if the observer determines that conditions warrant a failover. The following list indicates the extent to which fast-start failover is disabled in the broker configuration when the DISABLE FAST_START FAILOVER FORCE command is issued on the primary database, target standby database, and a standby database that is not the fast-start failover target.

    If you issue this command on:

    • The primary database, the primary database attempts to disable fast-start failover on as many databases in the configuration with which it has a network connection. If the primary database does not have connectivity with the target standby database, fast-start failover remains enabled on the target standby database and the observer may still attempt a fast-start failover if conditions warrant a failover.

      Caution:

      This action may result in two databases in the configuration simultaneously assuming the primary database role should fast-start failover occur.
    • The target standby database when it does not have connectivity with the primary database, fast-start failover is disabled only on the target standby database. In this case, the observer cannot perform a fast-start failover even if conditions warrant a failover. Disabling fast-start failover with the FORCE option when connected to the target standby database is the only method that guarantees fast-start failover will not occur.

      If the primary database and the target standby database regain network connectivity, the broker will disable fast-start failover for the entire broker configuration.

    • Another standby database that does not have connectivity with the primary database, fast-start failover is disabled for this database. Because fast-start failover was not disabled on the target standby database, the observer may still attempt a fast-start failover to the target standby database should conditions warrant a failover.

      Caution:

      When you are experiencing network disconnections and you issue the DISABLE FAST_START FAILOVER FORCE command on the primary database or a standby database that does not have connectivity with the primary database, fast-start failover may not be disabled for all databases in the broker configuration. As a result the observer may still initiate fast-start failover to the target standby database, if conditions warrant a failover. This may result in two databases in the configuration simultaneously assuming the primary database role.

Conditions Requiring the FORCE Option

Disabling fast-start failover without the FORCE option can succeed only if the database on which the command is issued has a network connection with the primary database and if the primary database and target standby database have a network connection. This is the recommended method for disabling fast-start failover.

However, there may be situations in which you must disable fast-start failover when the primary database and the target standby database do not have a network connection, or the database on which you issued the disable fast-start failover command does not have a network connection to the primary database. In cases where there is a lost network connection, be aware that the observer may attempt a fast-start failover to the target standby database if conditions warrant a failover.The FORCE option may be the preferred method for disabling fast-start failover when:

  • A network outage isolates the primary database from the observer and the target standby database, while the databases are synchronized.

    In this case, the primary database stalls and prevents any further transactions from committing because a fast-start failover may have occurred while it was isolated. If you expect the network to be disconnected for a long time, disable fast-start failover with the FORCE option on the primary database to allow processing to continue (without waiting for the connection to the target standby database or the observer computer to be restored).If possible, confirm that fast-start failover has not occurred to the target standby database prior to disabling fast-start failover with the FORCE option on the primary database.

    Caution:

    This action may result in two databases in the configuration simultaneously assuming the primary database role.
  • You want to conduct a manual failover to any standby database in the configuration (for example, because a failure occurred on the primary database at a time when the primary and target standby database were not synchronized).

    In this case fast-start failover cannot occur because the databases are not synchronized. You cannot perform a manual failover to the target standby database for the same reason. To proceed, you must first disable fast-start failover using the FORCE option, and then perform a manual failover.

    Caution:

    This action will result in loss of data and the possibility of two databases in the configuration simultaneously assuming the primary database role.
  • A fast-start failover to the target standby database fails.

    If the failover fails for any reason, it could leave the target standby database inoperable, regardless of whether the target standby database is synchronized. If there is another standby database that is available for failover, you can perform a manual failover to that standby database after you first disable fast-start failover using the FORCE option on that standby database.

  • You want to prevent fast-start failover from occurring because the primary database will resume service soon.

    In this case, disable fast-start failover using the FORCE option on the target standby database. Once the primary database regains connectivity with the target standby database, fast-start failover will be disabled for all the databases in the configuration.

Disabling Fast-Start Failover Using Enterprise Manager

Click Disable in the Fast-Start Failover wizard. Then, click Continue to proceed to the next page. See the Enterprise Manager online Help system for more information.

Disabling Fast-Start Failover Using DGMGRL

Issue the DISABLE FAST_START FAILOVER command or the DISABLE FAST_START FAILOVER FORCE command. See the "DISABLE FAST_START FAILOVER" command in Chapter 8 for more information.

Note:

Setting the DG_BROKER_START initialization parameter to FALSE implicitly disables fast-start failover.

5.5.5 Performance Considerations for Fast-Start Failover

Consider the following recommendations to obtain better performance when using fast-start failover:

  • Fast-start failover can be faster when the target of the failover is a logical standby database.

    This is because a logical standby database does not need to be restarted nor opened (it is already open) to assume the primary role. A physical standby database always needs to be opened, and may need to be restarted if it has been opened read-only since the last time it restarted.

  • The failover time is dependent upon whether the target standby database (physical or logical standby database) has applied all of the redo data it has received from the primary database.

  • Fast-start failover is faster when you take steps to optimize recovery so that the application of redo data to the standby database is kept up to date with the primary database's rate of redo application. To optimize the log apply rate:

5.5.6 Managing the Observer

The observer is integrated in the DGMGRL client-side component and runs on a different computer from the primary or standby databases and from the computer where you manage the broker configuration. The observer continuously monitors the fast-start failover environment to ensure the primary database is available (described in Section 5.5.2.1). The observer's main purpose is to enhance high availability and lights out computing by reducing the human intervention required by the manual failover process that can add minutes or hours to downtime.

You can manage the observer through either the Data Guard Overview pages in Oracle Enterprise Manager or using DGMGRL commands. Figure 5-2 shows how the observer monitoring a fast-start failover configuration.

Figure 5-2 The Observer in the Fast-Start Failover Environment

Description of Figure 5-2 follows
Description of "Figure 5-2 The Observer in the Fast-Start Failover Environment"

The following sections provide information about managing the observer:

5.5.6.1 Installing and Starting the Observer

The observer should be installed and run on a computer system that is separate from the primary and standby systems. Installing and starting the observer is an integral part of enabling fast-start failover and is described in detail in these sections:

  • Section 2.1 describes installing Oracle Database Enterprise Edition or Oracle Personal Edition on the observer system.

  • Section 5.5.2 describes how to start the observer as a part of the step-by-step process to enable fast-start failover. Examples for starting the observer through Oracle Enterprise Manager and DGMGRL are included in Section 6.4 and Section 7.6, respectively.

There can be only one observer monitoring the broker configuration. If you attempt to start another one, the broker returns the following error message:

ORA-16647: could not start more than one observer

To start the observer, you must be able to login to DGMGRL as SYS. The observer is an OCI client that connects to the primary and target standby databases using the same SYS credentials you used when you connected to the Data Guard configuration with DGMGRL.

5.5.6.2 Viewing Information About the Observer

You can find information about the observer by querying the following columns in the V$DATABASE view:

  • FS_FAILOVER_OBSERVER_HOST shows the name of the computer on which the observer is running

  • FS_FAILOVER_OBSERVER_PRESENT shows whether or not the observer is connected to the local database

Table 5-3 FS_FAILOVER_OBSERVER_PRESENT Column of the V$DATABASE View

Column ValueFoot 1  Description

YES

Observer is currently connected to the local database

NO

Observer is not connected to the local database


Footnote 1 This value is consistent across instances in a Real Applications Cluster (RAC). That is, if the observer is connected to any instance in the RAC, all instances will show a value of YES.

For example, to determine if fast-start failover can occur, the FS_FAILOVER_STATUS column displays SYNCHRONIZED and the FS_FAILOVER_OBSERVER_PRESENT column displays YES for the target standby database. For example:

Database FS_FAILOVER_STATUS FS_FAILOVER_OBSERVER_PRESENT
Primary SYNCHRONIZED YES
Standby SYNCHRONIZED YES

In the following example, assume the network between the primary database and the observer has failed. In this case, the FS_FAILOVER_STATUS and FS_FAILOVER_OBSERVER_PRESENT columns will appear as shown in the following table and fast-start failover will not occur:

Database FS_FAILOVER_STATUS FS_FAILOVER_OBSERVER_PRESENT
Primary SYNCHRONIZED NO
Standby PRIMARY UNOBSERVED YES

5.5.6.3 What Happens if the Observer Fails?

If the primary and target standby databases stay connected but the connection to the observer is lost, then the broker reports that the configuration is not observed. The configuration and database status report that the observer is not running and return the following status messages:

ORA_16658: unobserved Fast-Start Failover configuration
ORA-16820: Fast-Start Failover observer is no longer observing this database

While the configuration is in the unobserved state, fast-start failover cannot happen. Therefore, the primary database can continue processing transactions, even if the target standby database fails. The configuration status returns the SUCCESS status after the observer reestablishes its connection to the primary database, which then notifies the target standby database.

5.5.6.4 Stopping the Observer

You may want to stop the observer when you no longer want to use fast-start failover (see Section 5.5.4, "Disabling Fast-Start Failover") or if you want to move the observer to a different host machine (see Section 5.5.6.5, "Moving the Observer to Another Computer").

To stop the observer when fast-start failover is enabled, the primary database and target standby database must be connected and communicating with each other. Stopping the observer does not disable the fast-start failover. However, fast-start failover cannot occur when the primary database is in the unobserved state.

To stop the observer when fast-start failover is not enabled, only the primary database must be running.You can stop the observer while connected to any database in the broker configuration, as follows:

  • Using Enterprise Manager

    Choose the Stop Observer option on the first page of the fast-start failover wizard and click Continue at the bottom of the page. See the Enterprise Manager online help system for more information.

  • Using DGMGRL

    Issue the following command:

    DGMGRL> STOP OBSERVER;
    
    

    See the STOP OBSERVER command for more information.

    Note:

    The observer does not stop immediately when you issue STOP OBSERVER command. When the broker receives the STOP OBSERVER request, it informs the observer the next time the observer contacts the broker.

5.5.6.5 Moving the Observer to Another Computer

To move the observer to another computer:

  1. Stop the observer from any computer system in the broker configuration, as described in Section 5.5.6.4.

  2. Start the observer on the new computer system, as described in Step 5 of Section 5.5.2.

There is no need to disable fast-start failover when you move the observer.

5.5.6.6 How the Observer Maintains Fast-Start Failover Configuration Information

The observer persistently maintains information about the fast-start failover configuration in a binary file created in the working directory where you started the observer. By default, the observer creates this file when it is started and names the file fsfo.dat. This file contains connect descriptors to both the primary and the target standby databases. Ensure this file cannot be read by unauthorized users.

Once the file is created, you cannot change its name and location. However, you can change the name or the location of the file if you use the DGMGRL START OBSERVER command and include the FILE qualifier. See the START OBSERVER command for more information.

Note:

If the observer is stopped abnormally (for example, by typing CTRL/C), restart it and reference the existing fsfo.dat file with the FILE qualifier.

5.5.7 Reinstating the Former Primary Database in the Broker Configuration

After a fast-start failover completes successfully, the observer automatically attempts to reinstate the former primary database as a standby database. Reinstatement restores high availability to the broker configuration so that, in the event of a failure of the new primary database, another fast-start failover can occur. The reinstated database can act as the fast-start failover target for the new primary database, making a subsequent fast-start failover possible. The new standby database is a viable target of a failover when it begins applying redo data received from the new primary database.

The broker can reinstate the former primary database as a standby database without the need to reenable the primary database or manually performing the Flashback Database operation. To reinstate the former primary database, the database must be started and mounted, but it cannot be opened. The broker reinstates the database as a standby database of the same type as the former standby database.

If the former primary database cannot be reinstated automatically, you can manually reinstate it using either the DGMGRL REINSTATE command or Enterprise Manager. Step-by-step instructions for manual reinstatement are described in Section 5.4.3.

5.5.7.1 Requirements

Reinstatement is supported only after failover in a broker configuration. It also requires Flashback Database to be enabled on both the primary and target standby databases. Section 5.5.1 provides complete information about all of the fast-start failover and reinstatement requirements.

5.5.7.2 Restrictions on Reinstatement

The broker cannot automatically reinstate the former primary database if:

  • Another failover or switchover occurred after the fast-start failover completed but before the former primary database restarted.

  • Fast-start failover was disabled.

  • The observer cannot connect to the former primary database.

  • The former primary database cannot connect to the new primary database.

  • The former primary database and the new primary database are not configured in the same fast-start failover environment.

  • The former primary database was disabled because of a manual failover, not a fast-start failover.

    Note:

    Standby databases that are disabled during switchover, manual failover, or fast-start failover cannot be automatically reinstated.

If automatic reinstatement fails, the broker will log errors and the former primary database will remain in the mounted state. At this point, you can either:

  • Disable fast-start failover (described in Section 5.5.4) and attempt to open the former primary database.

  • Manually reinstate the former primary database, as described in Section 5.4.3.

5.5.7.3 How the Broker Handles a Failed Reinstatement

If a failure occurs once a reinstatement operation (automatic or manual) is underway, the broker logs the appropriate information in the broker configuration files and log files. The former primary database is disabled. Most in-progress failures cannot be restarted (for example, archived redo log file corruption on the primary database). You must reenable the database as a standby database manually, as described in Oracle Data Guard Concepts and Administration.

5.5.8 Shutting Down Databases In a Fast-Start Failover Environment

Perform the following steps if you need to shut down the primary or standby databases:

  1. Shut down the observer and wait for the FS_FAILOVER_OBSERVER_PRESENT column in the V$DATABASE fixed view to contain the value "NO" for both the primary and target standby databases.

  2. Shut down the primary database and the target standby database using either DGMGRL SHUTDOWN command or the SQL*Plus SHUTDOWN statement.

When restarting the databases, you may restart them in any order. When both databases have been restarted, you may restart the observer.