Professional Documents
Culture Documents
DATAGUARD
Ritesh Chhajer
Sr. Oracle DBA
Agenda
Physical vs. Logical Standby
Physical Standby
Kept in sync with the primary by using media recovery to apply redo generated on
primary
Used for BCP
Can be opened in read-only mode but redo won’t be applied for that time
Logical Standby
Kept in sync with the primary by transforming redo data received from primary into
logical SQL statements and then executing those SQLs against the standby database.
Used to offload reporting from the primary database
Can be opened in read-only mode while the changes are being applied.
Protection Modes
Decide on Standby Protection Mode before setting it up:
1. MAXIMUM PROTECTION
Pre-requisites
Using LGWR SYNC AFFIRM, transport of redo logs to be done in a synchronous fashion.
Standby redo logs (SRLs) need to be created on standby site.
At least one standby must be available for the primary database to function.
Need high speed network.
Pros
Zero data loss
Cons
Primary shuts down if in case of network issues unable to commit on standby at the same time.
Protection Modes
2. MAXIMUM AVAILABILITY
Pre-requisites
Using LGWR SYNC AFFIRM, transport of redo logs to be done in a synchronous fashion.
Standby redo logs (SRLs) need to be created on standby site.
Features
If network issues, switches to maximum performance and when the fault corrects switches back to
maximum availability.
Data loss only if primary loses it’s redo logs.
SQL> alter database set standby to maximize availability;
3. MAXIMUM PERFORMANCE
Asynchronous redo shipping using ARC or LGWR ASYNC.
No impact on primary’s performance even if network issues.
No need to create SRLs unless real-time apply is needed on the standby site.
Log Transport Services
Log Transport Service Attributes are defined on primary in log_archive_dest_2
ARC(default)
ARC will first archive the online redo log to local destination on primary. Then second ARC
process spawns and writes the archive to remote standby.
By default, log_archive_local_first=true in init.ora on primary. DO NOT CHANGE IT.
LGWR
In contrast to ARC, which transmits redo to standby only at log switch time, LGWR attribute
instructs LGWR process to transmit redo to standby at the same time while the redo is writing to
the online redo logs.
Transmission of redo can be done synchronously (SYNC) or asynchronously (ASYNC)
AFFIRM