The purpose of this blog is to guide you through configuring Oracle Data Guard Fast-Start Failover (FSFO) using Data guard broker with physical standby database.

Oracle Data Guard

Oracle Data Guard is one of the software solutions provided by Oracle Corporation to maximize high availability of Oracle databases. Oracle Data Guard maintains one or many secondary databases as alternatives to the primary production database.

The lab Environment

My environment consists of the following entities:

  • I have 3 VM with version of REHL 6 installed.
  • Both Primary and standby database version is 12.1.
  • Primary database is already created and ready for use and on standby server, the oracle software binaries has been installed.
  • Primary database/Unique name is DGTST/DGTST_PRIMY on host DGTST01
  • Standby database/Unique name is DGTST/DGTST_STBY on host DGTST02
  • The Data Guard Observer server name is DGTST03.

Note: The configuration of standby database on Oracle 12c with data guard is similar to Oracle 11g except few changes in log_archive_dest_2 and dgmgrl utility user access.

Primary Server set up

Logging

Check database is in archive log mode. If not, please put the database in archive log mode.

Check force database logging option is enabled.

Create standby redologs on primary database

Create standby redologs on primary database. Make sure standby log file size should be same as existing online logfile size.

Enable Flashback database

Put the primary database in flashback mode. Reset the recovery related parameters and restart the primary database on DGTST01.

Add parameters on primary database

Set below parameters to DGTST database at primary side.

Oracle Net configuration

Add TNS  entries as below on both primary and standby servers under location $ORACLE_HOME/network/admin/tnsnames.ora

Now add the static Listener entry to Primary as below.

For Standby database, listener entry should look like as below..Restart listener on both servers.

Standby Server Setup

Add standby instance names to standby nodes /etc/oratab.
DGTST:/oracle/product/12.1.0.2:N

Create a parameter file for standby database and create the necessary directories.

Create a password file, with the SYS password matching that of the primary database.
orapwd file=$ORACLE_HOME/dbs/orapw$ORACLE_SID password=

Create Standby Using RMAN DUPLICATE

Now parameter settings at standby database side. Restart database to pick up parameter changes.

Enable Broker

Add DB broker configuration from primary database. I already set the Db_broker_start= true.

In 12c, as soon as you enable the dg broker configuration the manage recovery will start.

Switchover operation

Note:  I am using GI for standalone database. So Clusterware restart the database. You need to register database with GI on both primary and standby side. Otherwise, swicthover will stuck with clusterware start up.

Register database with GI

Failover operation

Now it’s time to test the failover operation.

Reinstate the aborted primary as a standby

Next task is to reinstate the primary. Fix the problem with primary database server and reinstate the database as below. if flash back is not enabled then you have yo manually re-create the standby database.

Enable FSFO (Fast Start Fail Over)

FSFO can be enabled as below from data guard broker. Note that enabling FSFO does not make the configuration ready for automatic failover – that requires an observer, which we’ll get to next.

With FSFO enabled, Broker expects to find an observer, which we haven’t started yet, so if you verify the configuration at this point with ‘show configuration’, Broker will report a warning (if it doesn’t, give it a minute to discover that the observer isn’t there).

Configure Observer

To maximize the benefits of FSFO, the observer should run on a different host than the primary and standby databases. Ideally the primary, standby, and observer will be in geographically separate areas. The observer is very lightweight, requiring few system resources. Since the observer is a specialized instance of a dgmgrl session, the observer host should be installed with either the Oracle Client Administrator software or the full Oracle Database software stack.Use below script to start-up the observer. If you startup the observer without this script through sys account directly the terminal session will appear to hang and will stop the observer if you close the session.

Verify the configuration and can see all errors are now gone.

See observer logs as well.

 

Enjoy 🙂

Mandy

1 Comment

Leave a Reply