learn-oracle

Oracle DBA






Oracle Data Guard - Role Transitions


PREVIOUS CHAPTER 

A Data Guard configuration consists of one database that functions in the primary role and one or more databases that function in standby roles. Typically, the role of each database does not change. However, if Data Guard is used to maintain service in response to a primary database outage, you must initiate a role transition between the current primary database and one standby database in the configuration. To see the current role of the databases, query the DATABASE_ROLE column in the V$DATABASE view.

The number, location, and type (physical or logical) of standby databases in the Data Guard configuration and the way in which redo data from the primary database is propagated to each standby database determine, the role-management options available to you in response to a primary database outage.

Introduction to Role Transitions
A database operates in one of the following mutually exclusive roles: primary or standby. Data Guard enables you to change these roles dynamically by issuing the SQL statements described in this chapter, or by using either of the Data Guard broker's interfaces. Oracle Data Guard supports the following role transitions:

  • Switchover

    Allows the primary database to switch roles with one of its standby databases. There is no data loss during a switchover. After a switchover, each database continues to participate in the Data Guard configuration with its new role.

  • Failover

    Changes a standby database to the primary role in response to a primary database failure. If the primary database was not operating in either maximum protection mode or maximum availability mode before the failure, some data loss may occur. If Flashback Database is enabled, the failed database may be reinstated as a standby for the new primary database once the reason for the failure is corrected.

Choosing a Target Standby Database for a Role Transition
There are a number of factors to consider when choosing the target standby database for a role transition. These include the following:

Locality of the standby database.

The capability of the standby database (hardware specifications—such as the number of CPUs, I/O bandwidth available, and so on).

The time it will take to perform the role transition. This is affected by how far behind the standby database is in terms of application of redo data, and how much flexibility you have in terms of trading off application availability with data loss.

Data Guard provides the V$DATAGUARD_STATS view that can be used to estimate the viability of each standby database in terms of the currency of the data in the standby database, and the time it will take to perform a role transition if all available redo data is applied to the standby database.

Switchovers
A switchover is typically used to reduce primary database downtime during planned outages, such as operating system or hardware upgrades, or rolling upgrades of the Oracle database software and patch sets

The following figure shows a two-site Data Guard configuration before the roles of the databases are switched. The primary database is in San Francisco, and the standby database is in Boston.

Oracle dba

The following figure shows the Data Guard environment after the original primary database was switched over to a standby database, but before the original standby database has become the new primary database. At this stage, the Data Guard configuration temporarily has two standby databases.

Oracle dba

The following figure shows the Data Guard environment after a switchover took place. The original standby database became the new primary database. The primary database is now in Boston, and the standby database is now in San Francisco.

When a database is opened for the first time after a switchover, the DB_ROLE_CHANGE system event fires. You can write a trigger that's associated with this system event to manage tasks after a switchover occurs. You can query the DATABASE_ROLE column of the V$DATABASE view to determine its current role.

Oracle dba

Failovers
A failover is typically used only when the primary database becomes unavailable, and there is no possibility of restoring it to service within a reasonable period of time. The specific actions performed during a failover vary based on whether a logical or a physical standby database is involved in the failover, the state of the Data Guard configuration at the time of the failover, and on the specific SQL statements used to initiate the failover.

The following figure shows the result of a failover from a primary database in San Francisco to a physical standby database in Boston.

Oracle dba

PREVIOUS CHAPTER 

Want to see more FAQ..SEE TOP MENU

More Tutorials on Oracle dba ...


Liked it ? Want to share it ? Social Bookmarking

Add to: Mr. Wong Add to: BoniTrust Add to: Newsider Add to: Digg Add to: Del.icio.us Add to: Reddit Add to: Jumptags Add to: StumbleUpon Add to: Slashdot Add to: Netscape Add to: Furl Add to: Yahoo Add to: Spurl Add to: Google Add to: Blinklist Add to: Technorati Add to: Newsvine Information


Source : Oracle Documentation | Oracle DBA

Want to share or request Oracle Tutorial articles to become a Oracle DBA. Direct your requests to webmaster@oracleonline.info