We’ll start from the fundamentals, but at an expert level. The goal is not just to configure Data Guard, but to understand what Oracle is doing internally and why each configuration choice matters.
1. What Is Oracle Data Guard?
Oracle Data Guard provides a mechanism for maintaining one or more standby databases synchronized with a primary database.
The basic architecture is:
APPLICATION
|
v
+---------------+
| PRIMARY DB |
| PRODDB |
+---------------+
|
REDO TRANSPORT
|
+--------+--------+
| |
v v
SYNC / ASYNC SYNC / ASYNC
| |
v v
+-------------+ +-------------+
| PHYSICAL | | PHYSICAL |
| STANDBY | | STANDBY |
| DRDB | | REPORTDB |
+-------------+ +-------------+
The primary generates redo.
Data Guard transports that redo to the standby.
The standby applies the redo.
PRIMARY | | Redo v Standby Redo Logs | v Redo Apply | v Standby Database
That simple flow is the foundation for everything we’ll do in this series.
2. Data Guard Is Not Replication in the Traditional Sense
One of the most important concepts is this:
Data Guard protects the database by transporting and applying redo.
It is not simply:
Table A → Table A Table B → Table B
Instead:
SQL transaction
|
v
Database changes
|
v
Redo generated
|
v
Redo transport
|
v
Standby redo
|
v
Redo apply
|
v
Standby database
This is why understanding redo is essential before going deeply into Data Guard.
3. Primary and Standby Roles
A Data Guard configuration consists of database roles.
The most important ones are:
Primary
The database accepting production workload.
DATABASE_ROLE = PRIMARY
Physical Standby
A block-for-block physical copy maintained using redo apply.
DATABASE_ROLE = PHYSICAL STANDBY
Snapshot Standby
A physical standby temporarily converted to a read-write database for testing or other controlled activities.
DATABASE_ROLE = SNAPSHOT STANDBY
There are also logical and other standby configurations, but for our 19c Masterclass we’ll focus heavily on physical standby, because it is fundamental to modern production Data Guard deployments.
4. Check the Current Database Role
On the primary:
SELECT name,
db_unique_name,
database_role,
open_mode,
log_mode
FROM v$database;
Typical output:
NAME DB_UNIQUE_NAME DATABASE_ROLE OPEN_MODE LOG_MODE -------- --------------- --------------- ------------ ---------- PRODDB PRODDB PRIMARY READ WRITE ARCHIVELOG
On a physical standby:
NAME DB_UNIQUE_NAME DATABASE_ROLE OPEN_MODE -------- --------------- ------------------- --------------- PRODDB PRODDB_DR PHYSICAL STANDBY READ ONLY
Depending on configuration, a physical standby may instead be:
MOUNTED
when redo apply is running.
5. DB_NAME vs DB_UNIQUE_NAME
This is extremely important.
Suppose we have:
Primary: DB_NAME = PRODDB DB_UNIQUE_NAME = PRODDB Standby: DB_NAME = PRODDB DB_UNIQUE_NAME = PRODDB_DR
The databases have the same:
DB_NAME
but different:
DB_UNIQUE_NAME
This allows Oracle to distinguish the databases within the Data Guard configuration.
Think:
DB_NAME
|
PRODDB
/ \
/ \
PRODDB PRODDB_DR
DB_UNIQUE_NAME DB_UNIQUE_NAME
PRIMARY STANDBY
6. Why DB_UNIQUE_NAME Matters
You’ll see it everywhere:
show parameter db_unique_name
Example:
NAME TYPE VALUE ---------------- ----------- ----------- db_unique_name string PRODDB
On standby:
db_unique_name = PRODDB_DR
Data Guard Broker also uses these database identities.
For example:
DGMGRL> SHOW CONFIGURATION;
might display:
Configuration - PROD_DG
PRODDB
Primary database
PRODDB_DR
Physical standby database
7. The Three Main Data Guard Components
Think of Data Guard as three major layers:
DATA GUARD
|
+----------+----------+
| | |
v v v
REDO TRANSPORT APPLY
GENERATION
More precisely:
1. Redo generation
Primary creates redo.
2. Redo transport
Primary sends redo to standby.
3. Redo apply
Standby applies the redo.
If any of these three layers fail, synchronization is affected.
8. Redo Transport
The primary can transport redo using:
LGWR ARCH
and different transport modes.
For example:
SYNC ASYNC
Conceptually:
Primary | | LGWR SYNC | +------> Standby
or:
Primary | | LGWR ASYNC | +------> Standby
The choice has major implications for performance and data loss.
We’ll dedicate several parts to this later.
9. SYNC vs ASYNC
This is one of the most important Data Guard design decisions.
SYNC
The primary waits for acknowledgment from the standby before considering the redo transmission successful according to the configured protection semantics.
Conceptually:
Primary | | REDO v Standby | | ACK v Primary continues
ASYNC
The primary does not wait for the standby to acknowledge the redo before continuing.
Primary
|
| REDO
+---------------->
Standby
This generally reduces the performance impact on the primary but can introduce some potential data loss depending on the overall configuration.
10. Data Protection Modes
Oracle Data Guard provides three major protection modes:
Maximum Performance Maximum Availability Maximum Protection
These are not simply performance settings.
They define how Oracle balances:
Data protection + Availability + Performance
11. Maximum Performance
This is commonly associated with asynchronous redo transport.
Conceptually:
PRIMARY | | ASYNC v STANDBY
The primary does not normally wait for the standby.
Advantages:
- Lower primary latency
- Good for geographically distant standby systems
- Good performance
Potential drawback:
- Some redo may not have reached the standby when the primary fails.
Therefore:
RPO > 0
may be possible.
12. Maximum Availability
This mode is designed to provide stronger protection while allowing the primary to remain available if the standby cannot acknowledge redo.
Conceptually:
Primary | | SYNC v Standby
If the standby becomes temporarily unavailable, Oracle can allow the primary to continue depending on the configuration.
This is often attractive for production environments requiring strong protection without making the primary excessively dependent on standby availability.
13. Maximum Protection
This is the strictest protection mode.
The goal is:
No data loss.
The primary requires synchronous acknowledgment from a properly configured standby before committing transactions under normal protection operation.
If the required standby cannot participate, the primary may be prevented from continuing transactions.
Conceptually:
Application
|
v
PRIMARY
|
| SYNC
v
STANDBY
|
| ACK
v
COMMIT
This gives extremely strong protection but introduces a dependency on standby availability and network performance.
14. Protection Mode Comparison
| Mode | Typical Transport | Data Loss Risk | Primary Impact |
|---|---|---|---|
| Maximum Performance | ASYNC | Possible | Lowest |
| Maximum Availability | SYNC-oriented | Very low / configuration dependent | Moderate |
| Maximum Protection | SYNC | Designed for zero data loss | Highest |
The exact behavior depends on the transport attributes, standby configuration, network and protection settings.
15. Physical Standby Architecture
Our main lab architecture will eventually look like this:
Application
|
v
+---------------+
| RAC PRIMARY |
| |
| RAC1 RAC2 |
+---------------+
| |
+---+---+
|
REDO
|
Network / VIP
|
v
+---------------+
| RAC STANDBY |
| |
| DR1 DR2 |
+---------------+
We’ll progressively build this architecture in later parts.
16. RAC + Data Guard
This is where the Masterclass becomes more interesting.
Suppose:
Primary RAC NODE1 THREAD 1 NODE2 THREAD 2
The standby must handle redo from both threads.
PRIMARY RAC
/ \
THREAD 1 THREAD 2
| |
+-------+-------+
|
REDO
|
v
STANDBY RAC
This is why RAC Data Guard troubleshooting requires a solid understanding of redo threads.
17. Check RAC Threads
On the primary:
SELECT thread#,
instance,
status,
enabled
FROM v$thread
ORDER BY thread#;
Example:
THREAD# INSTANCE STATUS ENABLED ------- -------- ------ ------- 1 PROD1 OPEN PUBLIC 2 PROD2 OPEN PUBLIC
Then inspect redo:
SELECT thread#,
group#,
sequence#,
bytes/1024/1024 AS size_mb,
status
FROM gv$log
ORDER BY thread#, group#;
18. Standby Redo Logs
This is a topic we will cover deeply in Part 5.
The basic concept:
Primary Redo
|
v
Standby Redo Log
|
v
Redo Apply
Standby redo logs allow redo to be received and written on the standby before the corresponding archived log is completed.
They are particularly important for:
- Real-time apply
- Synchronous transport
- Maximum Availability
- Maximum Protection
- RAC environments
19. Real-Time Apply
Without real-time apply:
Redo ↓ Archive log ↓ Standby apply
With real-time apply:
Redo ↓ Standby Redo Log ↓ Apply
The standby can apply redo as it is received rather than waiting for the primary redo log to be archived.
This can significantly reduce apply lag.
20. Data Guard Broker
For serious Oracle 19c environments, we will use:
DGMGRL
Oracle Data Guard Broker provides centralized management and monitoring.
Instead of manually managing every parameter, you can use:
DGMGRL
to manage the configuration.
Start with:
dgmgrl /
Then:
DGMGRL> SHOW CONFIGURATION;
21. Typical Broker Configuration
Example:
Configuration - PROD_DG Protection Mode: MaxAvailability Members: PRODDB Primary database PRODDB_DR Physical standby database Fast-Start Failover: DISABLED Configuration Status: SUCCESS
This single screen becomes one of the most important operational views for a Data Guard DBA.
22. Broker Database Status
Run:
DGMGRL> SHOW DATABASE PRODDB;
and:
DGMGRL> SHOW DATABASE PRODDB_DR;
For detailed information:
DGMGRL> SHOW DATABASE VERBOSE PRODDB_DR;
We’ll learn exactly how to interpret every important property later.
23. The Three Lag Concepts
When monitoring Data Guard, don’t simply ask:
“Is the standby synchronized?”
You need to understand:
Transport Lag
How much redo has not yet reached the standby.
Primary generated
|
|---- not transported ----|
Standby
Apply Lag
Redo has reached the standby but has not yet been applied.
Primary → Standby
|
|---- received
|
+---- not applied
Apply Rate
How quickly the standby is applying redo.
These three metrics tell you where the problem is.
24. Example
Suppose:
Transport Lag = 0 seconds Apply Lag = 45 minutes
This means:
Network transport
✓
Standby receiving redo
✓
Redo apply
X / slow
You should investigate the standby apply process rather than the network.
Conversely:
Transport Lag = 45 minutes Apply Lag = 0
suggests a transport problem.
This distinction will become extremely important in our troubleshooting labs.
25. Data Guard Failure Model
When Data Guard is unhealthy, think in this order:
DATA GUARD
|
+----------+----------+
| | |
Primary Network Standby
| | |
v v v
Redo Transport Apply
Generation Failure Failure
Ask:
- Is the primary generating redo?
- Is redo being transported?
- Is the standby receiving it?
- Are standby redo logs working?
- Is redo apply running?
- Is apply keeping up?
This diagnostic sequence will save enormous troubleshooting time.
26. Important Views
We’ll repeatedly use these throughout the Masterclass.
Database role
SELECT name,
db_unique_name,
database_role,
open_mode,
protection_mode,
protection_level
FROM v$database;
Standby status
SELECT process,
status,
thread#,
sequence#
FROM v$managed_standby;
Depending on the exact 19c environment, additional views such as V$DATAGUARD_PROCESS are also useful for modern Data Guard process monitoring.
Archive destination
SELECT dest_id,
status,
destination,
target,
error
FROM v$archive_dest
WHERE status <> 'INACTIVE';
27. Data Guard Processes
You will encounter processes such as:
LNS RFS MRP
Conceptually:
PRIMARY | | LNS v NETWORK | v STANDBY | | RFS v Standby Redo Logs | | MRP v Database
This diagram is worth memorizing.
28. LNS
LNS relates to redo transport from the primary.
Think:
LNS ↓ Transport redo ↓ Standby
If transport is broken, LNS-related behavior and destination status become important investigation points.
29. RFS
RFS is the standby-side process that receives redo transported from the primary.
Primary | v Network | v RFS | v Standby Redo Log
30. MRP
MRP is associated with managed recovery and applying redo on a physical standby.
Conceptually:
Standby Redo
|
v
MRP
|
v
Datafiles
If redo is arriving but not being applied, MRP becomes one of the first things to investigate.
31. Basic Standby Monitoring
On the standby:
SELECT process,
status,
thread#,
sequence#
FROM v$managed_standby
ORDER BY process;
You may see processes such as:
PROCESS STATUS ------- -------------------- RFS RECEIVING MRP0 APPLYING_LOG
This tells you immediately that redo is being received and applied.
32. Check Archive Destinations
On primary:
SELECT dest_id,
status,
target,
destination,
error
FROM v$archive_dest
WHERE target = 'STANDBY';
Pay particular attention to:
STATUS ERROR
An error here can immediately explain a transport problem.
33. Check Data Guard Configuration
On the primary:
SELECT dest_id,
status,
destination,
db_unique_name,
valid_now,
error
FROM v$archive_dest
WHERE target = 'STANDBY';
Example:
DEST_ID STATUS ------- --------- 2 VALID
Good.
If:
STATUS --------- ERROR
investigate before doing anything else.
34. Data Guard Broker Health
Once Broker is configured:
DGMGRL> SHOW CONFIGURATION;
A healthy system should show something similar to:
Configuration Status: SUCCESS
If you see:
WARNING
or:
ERROR
don’t ignore it.
35. The Production DBA Mindset
Suppose somebody tells you:
“Data Guard is down.”
That statement isn’t technically useful.
You should ask:
Is transport down? Is apply down? Is the standby unavailable? Is there an archive gap? Is the broker disabled? Is the database mounted? Is the standby lagging? Is the network unavailable?
The objective is to transform:
"Data Guard is down"
into:
Transport failure
or:
Apply failure
or:
Archive gap
or:
Database role/configuration issue
That’s expert troubleshooting.
36. Our Masterclass Lab
Throughout this series, we’ll build toward this environment:
CLIENTS
|
v
+-------------+
| PRIMARY RAC |
+-------------+
| |
RAC1 RAC2
THREAD 1 THREAD 2
\ /
\ /
\ /
\ /
REDO TRANSPORT
|
+-----+-----+
| |
v v
DR RAC1 DR RAC2
\ /
\ /
STANDBY
|
REDO APPLY
Storage:
PRIMARY +DATA +RECO STANDBY +DATA +RECO
Management:
DGMGRL | +-- Primary | +-- Standby
37. Part 1 Practical Lab
Before creating anything, collect information from the primary.
Database
SELECT name,
db_unique_name,
database_role,
open_mode,
log_mode,
protection_mode,
protection_level
FROM v$database;
RAC instances
SELECT inst_id,
instance_number,
instance_name,
host_name,
status
FROM gv$instance
ORDER BY inst_id;
Threads
SELECT thread#,
instance,
status,
enabled
FROM v$thread
ORDER BY thread#;
Redo
SELECT thread#,
group#,
sequence#,
bytes/1024/1024 AS size_mb,
status
FROM gv$log
ORDER BY thread#, group#;
Archive destinations
SELECT dest_id,
status,
target,
destination,
db_unique_name,
error
FROM v$archive_dest
WHERE status <> 'INACTIVE'
ORDER BY dest_id;
38. Your First Data Guard Health Snapshot
Put all of that together:
SELECT name,
db_unique_name,
database_role,
open_mode,
log_mode,
protection_mode,
protection_level
FROM v$database;
Then:
SELECT inst_id,
instance_name,
host_name,
status
FROM gv$instance;
Then:
SELECT thread#,
instance,
status,
enabled
FROM v$thread;
Then:
SELECT dest_id,
status,
target,
destination,
db_unique_name,
error
FROM v$archive_dest
WHERE status <> 'INACTIVE';
This becomes the foundation for the Data Guard Health Check Script we’ll eventually build in Part 47.
39. Expert-Level Question
Imagine you have:
Primary RAC Thread 1 Thread 2 Physical Standby Transport Lag = 0 Apply Lag = 2 hours
What should you investigate first?
Answer: redo apply.
Why?
Because transport is apparently keeping up, while the standby is falling behind during application of the received redo.
The next investigation would include:
SELECT process,
status,
thread#,
sequence#
FROM v$managed_standby;
and the relevant Data Guard/Broker status.
40. Part 1 — Expert Checklist
By the end of this part, you should be comfortable explaining:
✓ Primary database ✓ Physical standby ✓ DB_NAME ✓ DB_UNIQUE_NAME ✓ Redo generation ✓ Redo transport ✓ Redo apply ✓ SYNC ✓ ASYNC ✓ Maximum Performance ✓ Maximum Availability ✓ Maximum Protection ✓ Standby Redo Logs ✓ Real-Time Apply ✓ LNS ✓ RFS ✓ MRP ✓ Transport Lag ✓ Apply Lag ✓ RAC redo threads ✓ Data Guard Broker
Most importantly, remember this model:
PRIMARY
|
REDO GENERATION
|
v
REDO TRANSPORT
|
v
STANDBY REDO LOG
|
v
REDO APPLY
|
v
STANDBY
Once this is clear, the configuration commands in the next parts will make much more sense.


