Overview
Oracle Data Guard maintains synchronized standby databases for disaster recovery and read offload. Physical standby applies redo directly; logical standby allows different schema layouts.
Primary ships redo via ARCH and LGWR processes depending on protection mode.
Implementation
Use RMAN DUPLICATE or DGMGRL to create the standby. Set LOG_ARCHIVE_DEST_2 for remote redo. Enable managed recovery on standby: recover managed standby database using current logfile disconnect.
Protection modes: Max Performance, Max Availability, Max Protection—trade sync latency vs data loss risk.
When implementing guidance from Oracle Replication through Oracle Data Guard, start in a controlled environment that mirrors production versions of operating systems, runtimes, and network policies. Capture a baseline before changes: export configs, snapshot VMs, or tag releases in source control so rollback stays straightforward if behavior regresses.
Document prerequisites, expected outcomes, and verification steps in a short runbook. Automated checks—smoke tests, health endpoints, or query validations—catch regressions early when platforms receive patches. Security belongs in every workflow: apply least privilege, rotate secrets, and review audit logs after deployment.
If results differ across machines, compare environment variables, permission models, time zones, and regional settings. Intermittent issues often trace to caching layers, stale DNS, or duplicated services bound to the same port.
Example
-- Primary
ALTER SYSTEM SET LOG_ARCHIVE_DEST_2='SERVICE=stby ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=stby';
-- Standby
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT;
Tips
- Test switchover quarterly.
- Monitor apply lag in V$DATAGUARD_STATS.
- Use Far Sync for zero data loss at distance.
- Patch primary and standby compatibly.
- Re-verify after reboots, certificate renewals, or failover exercises.
- Align monitoring and alerts with the failure modes described in this guide.
- Keep vendor documentation links handy for breaking changes between versions.
- Pair automation with a manual spot check during initial production rollout.