Oracle Data Guard Fundamentals &
Architecture (DEEP MASTER GUIDE)
1. What is Oracle Data Guard (True Concept)
Oracle Data Guard is not a replication tool. It is a redo-stream based distributed recovery
architecture.
It ensures high availability, disaster recovery, and data protection by continuously shipping
redo changes
from primary database to standby database where recovery engine reconstructs
transactions.
2. Core Architecture (Internal View)
Data Guard consists of three major internal planes:
1. Data Plane (Primary Database)
- Executes transactions
- Generates redo in log buffer
- LGWR writes redo to redo logs
2. Transport Plane
- LNS/ARCH ships redo to standby
- Uses SYNC / ASYNC / FASTSYNC modes
- Uses Oracle Net (SDU/TDU buffers)
3. Apply Plane
- RFS receives redo
- MRP applies redo continuously
- Maintains consistency using SCN ordering
3. Redo Generation Internals
Redo is generated whenever a transaction modifies data blocks.
Flow:
User Transaction → Buffer Cache Change → Redo Entry → Log Buffer → LGWR → Online
Redo Logs
Important:
Redo contains change vectors, not full data blocks.
4. Redo Transport Mechanism
Redo transport moves redo from primary to standby.
Modes:
- SYNC: commit waits for standby ACK (zero data loss)
- ASYNC: commit does not wait (better performance, possible data loss)
- FASTSYNC: hybrid optimization
Flow:
Redo Logs → LNS → Network → RFS → Standby Redo Logs
5. Internal Data Guard Processes
LGWR: writes redo to disk
LNS: ships redo to standby
RFS: receives redo at standby
MRP: applies redo continuously
ARCH: archive-based shipping process
6. Standby Database Types
1. Physical Standby:
- Block-for-block copy
- Uses Redo Apply (MRP)
- Used for disaster recovery
2. Logical Standby:
- Uses SQL Apply
- Allows transformations and queries
3. Snapshot Standby:
- Temporarily read-write
- Can revert back
7. Apply Engine (MRP Deep Concept)
MRP (Managed Recovery Process) applies redo sequentially.
Steps:
- Receive redo from RFS
- Write into standby redo logs
- Validate SCN ordering
- Apply changes to datafiles
Standby is always in recovery mode.
8. Active Data Guard
Active Data Guard allows read-only access on standby while redo apply continues.
Used for:
- Reporting
- Analytics
- Backup offload
- Read scaling
9. Protection Modes
MAX PROTECTION:
- Zero data loss
- Primary stops if standby fails
MAX AVAILABILITY:
- Balanced mode
- Preferred enterprise mode
MAX PERFORMANCE:
- Async mode
- Highest performance
10. Data Guard Broker
Broker is the management layer of Data Guard.
Functions:
- Automates configuration
- Manages switchover/failover
- Enables FSFO
- Provides DGMGRL interface
11. FSFO (Fast Start Failover)
FSFO is an automated failover mechanism using Observer.
Decision Flow:
- Monitor heartbeat
- Check standby health
- Validate apply lag
- Trigger failover if safe
Risk: network partition may cause false failover
12. Switchover vs Failover
Switchover:
- Planned role change
- No data loss
Failover:
- Emergency role change
- Possible minimal data loss
13. RAC + ASM Integration
RAC provides multi-instance database availability.
ASM manages storage.
Data Guard provides disaster recovery across sites.
Together they form enterprise HA architecture.
14. Monitoring & Troubleshooting
Key Views:
- V$DATAGUARD_STATS
- V$ARCHIVE_DEST_STATUS
- V$MANAGED_STANDBY
Common issues:
- Apply lag
- Transport lag
- Archive gap
- Network failure
15. Interview Master Section
Key Questions:
- What is Data Guard architecture?
- SYNC vs ASYNC difference?
- What is MRP?
- How FSFO works?
- Difference between physical and logical standby?