top of page

Data Guard Introduction

Overview of Dataguard

One of the top priority for any organization is high availability of data. Unwanted downtime of database server may cause an organization to suffer from heavy financial loss and might also result in a lot of dissatisfied customers. One of the high availability database feature provided by oracle is data guard.

Before we begin understanding how data guard works let us understand what happens when you execute a simple transaction without any data guard configuration.

  1. Whenever you execute any DML the redo information is first written in the redo log buffer.

  2. At regular interval the information from the redo log buffer is written into the online redo log files by the log writer. The contents of the online redo log files contain sufficient information to re-execute the DML statements if needed for example in order to perform Instance Recovery.

DataGuard Architecture

Now let us understand the way in which the Data Guard works:

1. In case of Data Guard apart from writing the changes to the Online Redo Logs, the LGWR also transfers the changes to the LNS (Log Writer Network Server) process.

2. The LNS then transfer the changes to the RFS (Remote File Server) process. Next RFS writes the received changes to the Standby Redo Logs.

3. Based on whether you have opted for Physical Standby or Logical Standby the recovery of the standby datafiles are performed by the MRP (Media Recovery Process) or the LSP (Logical Standby Process) respectively.

4. There is also the ARCn or the Archiver process running on both the primary and the standby. In primary it archives the information from the online redo log files to the archive log files and in the standby it writes the information from the standby logs to the archive logs.

The role of the Archiver and the Archive logs will be clear when we talk about Gap Resolution.

Dataguard standby types

There are two modes in which you can configure the standby database in a Data Guard environment:

1. Physical Standby

2. Logical Standby

Physical Standby:

For a physical standby the changes are applied to the datafiles of the standby database by performing media recovery by the MRP background process.

Logical Standby:

In a logical standby the changes are applied to the datafiles of the standby database by re-executing the SQL statements which is fetched using Logminer from the standby redo logs. This process is also referred to as SQL Apply

I will discuss more about Physical and Logical Standby in the topics of Creating a Physical standby and logical standby respectively.

The Concept of SYNC, ASYNC, AFFIRM and NOAFFIRM

SYNC

In SYNC mode the following steps happens:

1. The LGWR of the primary database sends the change information of the primary database to the LNS of the primary database.

2. LNS of primary database sends redo info to RFS of standby database.

3. The RFS of standby database sends a confirmation to the LNS of the primary database.

4.The LNS of primary sends a signal to the LGWR of the primary confirming the same.

5. The LGWR of the primary sends the next set of redo information to the

ASYNC

In ASYNC the LNS of primary database does not wait for any confirmation from the RFS of the standby database before sending the next set of redo information.

AFFIRM

1. This indicates that the confirmation from the RFS of the standby will be sent to the LNS of the primary only if the RFS has successfully written the redo information to the standby redo logs.

NOAFFIRM

1. This indicates that the RFS need not wait for confirmation of successful write operation to the standby redo logs before sending confirmation to the LNS of the primary database.

Note: SYNC or ASYNC is about receiving the redo information whereas AFFIRM or NOAFFIRM is about confirmation of RFS successfully writing the changes to Standby Redo Logs

Far Sync or Fast Sync (12c New Feature)

In12c data guard, Oracle has introduced a new concept referred to as Far Sync or Fast Sync. The basic steps of it are as follows:

1. The Far Sync instance is a minimal server that has only standby redo logs i.e. it has no datafiles on which it will apply the changes.

2. The LNS of the primary will send the redo information in SYNC mode to a Fast Sync Instance which will write the changes in its Standby Redo logs

3. The Fast Sync Instance in turn will send the information in ASYNC mode to the remote standby databases.

The main advantage of Far Sync is that primary is not effected by the distance of the standby from itself. Thus reducing the network delay and improving the performance of the primary database. Additionally the far sync instance can be configured on a server with minimal configuration.The only thing to remember is that the Far Sync Server should at a short distance away, the acceptable range is up to 250 km.

Protection Modes

Protection Mode defines how your to treat the data inconsistency between your primary and standby database.

There are three types of protection modes:

1. Maximum Protection

2. Maximum Performance

3. Maximum Availability

Maximum Protection:

Here if due to any reason the LNS primary database does not receive a confirmation from the RFS of the standby within a specific period of time the primary database is shutdown thereby ensuring that there are no difference in the data present in the primary database and the standby database.

For Maximum Protection the data guard has to be in SYNC, AFFIRM mode

Maximum Performance:

In a Maximum Performance the primary database LNS process does not wait for any confirmation from the standby RFS before shipping the next set of changes information.

For Maximum Performance the data guard has to be in ASYNC, NOAFFIRM mode

Maximum Availability:

If you configure the data guard in Maximum Availability mode then your data guard will behave as if it is in Maximum Protection mode, however if it stops receiving the confirmation from the standby RFS it will switch itself to the Maximum Performance mode.

For Maximum Availability the data guard has to be in SYNC mode

Featured Posts
Recent Posts
Archive
Search By Tags
No tags yet.
Follow Us
  • Facebook Basic Square
  • Twitter Basic Square
  • Google+ Basic Square
bottom of page