Oracle Data Guard

Also known as: Data Guard

On this page 7

Oracle Data Guard is the Oracle Database feature that creates and maintains one or more standby databases as transactionally consistent copies of a primary database by continuously shipping and applying redo data. In database replication, Data Guard is the native high availability and disaster recovery solution for Oracle, combining physical or logical replication with role management for planned and unplanned outages.

Data Guard is included with Oracle Database Enterprise Edition, while its extension Active Data Guard is separately licensed and adds read-only access to an open physical standby during apply. Administrators manage configurations through SQL, the Data Guard broker command-line interface DGMGRL or Oracle Enterprise Manager.

How Oracle Data Guard ships and applies redo

Data Guard replicates by transporting redo records, the change vectors that the primary already writes to its online redo logs for crash recovery. The redo transport services send this redo over Oracle Net to each standby, where it lands in standby redo log files and is then applied by apply services.

On a physical standby, the Redo Apply process performs media recovery, so the standby remains block-for-block identical to the primary. On a logical standby, SQL Apply mines the redo with LogMiner technology, converts it into SQL statements and executes them, which allows a different physical structure and additional local objects.

ComponentLocationFunction
Log writer and transport processesPrimarySend redo synchronously or asynchronously
Remote file server (RFS)StandbyReceives redo and writes standby redo logs
Managed recovery process (MRP)Physical standbyApplies redo through media recovery
Logical standby process (LSP)Logical standbyApplies mined SQL transactions
Data Guard broker (DMON)All databasesMonitors health and automates role changes
Core processes in a Data Guard configuration

Standby database types

Data Guard supports three standby types, and the choice determines what the standby can do while it stays current. Most production configurations use a physical standby because it supports every data type and has the simplest, most robust apply path.

Standby typeApply methodOpen for queriesTypical use
Physical standbyRedo ApplyRead-only with Active Data GuardDisaster recovery and reporting offload
Logical standbySQL ApplyRead-write for non-replicated objectsReporting with extra indexes, rolling upgrades
Snapshot standbyRedo received but not appliedRead-write, changes discarded laterTesting against production-like data
Data Guard standby types and their uses

A snapshot standby is converted from a physical standby and keeps receiving redo while testers modify it. When it is converted back, Oracle uses a guaranteed restore point and Flashback Database to discard the test changes and then applies the accumulated redo.

Protection modes and transport settings

The protection mode defines how strongly Data Guard guarantees zero data loss and how the primary behaves when a standby becomes unreachable. It combines redo transport attributes, SYNC or ASYNC and AFFIRM or NOAFFIRM, with rules about stalling the primary.

Protection modeTransportData loss on failoverPrimary behavior on standby failure
Maximum protectionSYNC AFFIRMZeroShuts down if no synchronized standby remains
Maximum availabilitySYNC AFFIRM or SYNC NOAFFIRMZero in normal operationContinues and resynchronizes later
Maximum performanceASYNCSeconds of redo, depending on lagUnaffected
Data Guard protection modes

Synchronous transport adds network round-trip time to every commit, so maximum availability is practical within metropolitan distances, usually tens of kilometers, while maximum performance suits remote disaster recovery sites. Far Sync instances relay synchronous redo from a nearby lightweight instance to a distant standby, combining zero data loss with long distance.

Switchover, failover and fast-start failover

Data Guard distinguishes planned and unplanned role transitions. A switchover exchanges the roles of the primary and a standby with no data loss, typically for maintenance, and both databases remain part of the configuration. A failover promotes a standby after the primary fails, and the old primary must later be reinstated, often with Flashback Database, or rebuilt.

Fast-start failover lets the broker fail over automatically. A separate observer process, ideally at a third site, monitors both databases; when the primary is lost and a configurable threshold, commonly 30 seconds, passes, the observer initiates failover. This third vantage point prevents a split-brain situation in which both sites believe they are primary.

Applications need their own preparation for role changes. Role-based database services start only on the database currently holding a given role, so clients connecting through a service name follow the primary automatically. Combined with Fast Application Notification and Application Continuity, in-flight sessions can be redirected or replayed, which shortens the outage that users actually experience.

Regular switchover rehearsals are the most reliable way to confirm that a configuration works. Many operators perform one each quarter, alternating which site runs production, so that network rules, backups, monitoring and application connection strings are proven on both sides before a real disaster tests them.

Data Guard compared with other replication approaches

Data Guard is often compared with Oracle GoldenGate and with replication in other database systems. Its defining characteristic is redo-based, whole-database replication under one Oracle version and platform family, which makes it simpler and more complete than logical tools but less flexible.

TechnologyReplication basisScopeMain strength
Oracle Data GuardPhysical or logical redo applyEntire databaseZero data loss and automated failover
Oracle GoldenGateLog-based change captureSelected tables, heterogeneous targetsBidirectional and cross-platform replication
PostgreSQL streaming replicationWrite-ahead log shippingEntire clusterBuilt-in physical standbys
SQL Server Always On availability groupsLog block shippingGroup of databasesReadable secondaries with listener failover
Oracle Data Guard versus related technologies

Common pitfalls include missing standby redo logs, which force less efficient archive-based transport, untested switchovers, NOLOGGING operations that leave unrecoverable blocks on the standby unless FORCE LOGGING is enabled, and ignoring apply lag during peak batch windows.

Explained without jargon

Think of a shop that keeps a second, identical shop in another city. Every sale written in the main ledger is also phoned through to the second shop, which copies it into its own ledger within moments. If the main shop burns down, the second one opens its doors with almost every record intact.

Oracle Data Guard is that arrangement for an Oracle database. It keeps a live copy elsewhere and makes switching to that copy quick, planned or not.

A typical use case

A regional bank runs its core banking system on an Oracle database in a primary data center. A physical standby sits in a second data center 25 kilometers away, configured in maximum availability mode with synchronous transport, and a third standby 600 kilometers away receives redo asynchronously. A fast-start failover observer runs in a small cloud region.

During a power failure at the primary site, the observer detects the outage, and the broker promotes the nearby standby within about a minute. Applications reconnect through a role-based database service, no committed transaction is lost, and the bank later reinstates the old primary as a standby using Flashback Database.