Disaster Recovery for Oracle Database
Disaster Recovery (DR) for an Oracle Database in a large Healthcare Organization requires a robust, highly available, and secure approach to ensure business continuity, patient data integrity, and compliance with regulatory standards (e.g., HIPAA, GDPR). Below is a structured best industrial approach for DR:
1. Disaster Recovery Strategy
2. Oracle Database High Availability (HA) & Disaster Recovery (DR) Options
A. High Availability (HA)
B. Disaster Recovery (DR) Architecture
1. On-Premises DR
2. Cloud-Based DR
3. Backup Strategy & Retention Policy
4. DR Testing & Automation
5. Security & Compliance
6. Incident Response & Recovery Steps
7. Cost Optimization
Final Thoughts
For a large healthcare organization, an Oracle Data Guard (Active or Physical Standby) with RMAN backups and periodic DR drills is the best industrial approach. If a cloud hybrid strategy is feasible, OCI or AWS DR with automation provides enhanced scalability.
Detailed Implementation Plan with Automation Scripts
Here’s a detailed implementation plan along with automation scripts for setting up a Disaster Recovery (DR) solution for an Oracle Database in a large healthcare organization.
1️⃣ Implementation Plan for Oracle Database Disaster Recovery
The plan is divided into three phases: Setup, Testing, and Automation.
📌 PHASE 1: DR SETUP
1.1 Choose the Disaster Recovery Model
DR Model
RTO
RPO
Suitable For
Data Guard (Physical Standby)
Minutes
Zero
Critical OLTP Systems
Active Data Guard (Read-Only Standby)
Seconds
Zero
Workload Offloading, Reporting
Cloud DR (OCI/AWS/Azure)
15-30 min
< 5 min
Hybrid Cloud DR
RMAN Backup with PITR
Hours
< 24h
Cost-Effective DR
👉 Recommended: Data Guard with FSFO (Fast Start Failover) + RMAN for Archival Backup
1.2 Setup Primary & Standby Database
Step 1: Enable Force Logging on Primary
ALTER DATABASE FORCE LOGGING;
Step 2: Enable Archive Logging
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
ALTER DATABASE ARCHIVELOG;
ALTER DATABASE OPEN;
Step 3: Configure Standby Redo Logs (SRLs)
ALTER DATABASE ADD STANDBY LOGFILE GROUP 4 ('/u02/oradata/STDBY_redo01.log') SIZE 512M;
ALTER DATABASE ADD STANDBY LOGFILE GROUP 5 ('/u02/oradata/STDBY_redo02.log') SIZE 512M;
Step 4: Create a Standby Control File
ALTER DATABASE CREATE STANDBY CONTROLFILE AS '/backup/STANDBY.ctl';
Step 5: Copy Files to Standby Server
scp /backup/STANDBY.ctl oracle@standby:/u02/oradata/
scp /etc/oratab oracle@standby:/etc/
Step 6: Configure tnsnames.ora & listener.ora
Edit /etc/tnsnames.ora to include:
PRIMARY_DB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = primary_host)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = PRIMARY_DB)
)
)
STANDBY_DB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = standby_host)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = STANDBY_DB)
)
)
Step 7: Start Data Guard Broker
dgmgrl sys@PRIMARY_DB
CREATE CONFIGURATION 'DG_CONFIG' AS PRIMARY DATABASE IS 'PRIMARY_DB' CONNECT IDENTIFIER IS PRIMARY_DB;
ADD DATABASE 'STANDBY_DB' AS CONNECT IDENTIFIER IS STANDBY_DB MAINTAINED AS PHYSICAL;
ENABLE CONFIGURATION;
ENABLE DATABASE PRIMARY_DB;
ENABLE DATABASE STANDBY_DB;
📌 PHASE 2: DR TESTING
2.1 Validate Data Guard
SELECT DATABASE_ROLE, OPEN_MODE FROM V$DATABASE;
Expected Output:
2.2 Simulate Failover
dgmgrl sys@PRIMARY_DB
SHOW CONFIGURATION;
SHOW DATABASE STANDBY_DB;
SWITCHOVER TO STANDBY_DB;
Verify Switchover:
SELECT DATABASE_ROLE, OPEN_MODE FROM V$DATABASE;
📌 PHASE 3: AUTOMATION & MONITORING
3.1 Automate RMAN Backup
cat > /home/oracle/rman_backup.sh <<EOF
#!/bin/bash
export ORACLE_SID=primarydb
export ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1
rman target / <<EOF
BACKUP DATABASE PLUS ARCHIVELOG;
DELETE OBSOLETE;
EXIT;
EOF
Schedule it via Cron:
crontab -e
Add:
0 2 * /home/oracle/rman_backup.sh > /home/oracle/logs/backup.log 2>&1
3.2 Automate Failover using Fast Start Failover (FSFO)
dgmgrl sys@PRIMARY_DB
ENABLE FAST_START FAILOVER;
SHOW FAST_START FAILOVER;
3.3 Monitor & Alerting
Monitor Standby Status
SELECT DEST_ID, STATUS, ERROR FROM V$ARCHIVE_DEST_STATUS;
Enable Email Alerts for Failures
Edit /etc/ssmtp/ssmtp.conf (for Linux Mail Alerts):
mailhub=smtp.gmail.com:587
AuthUser=username
AuthPass=password
UseSTARTTLS=YES
Add an Alert Script:
cat > /home/oracle/alert_monitor.sh <<EOF
#!/bin/bash
LOGFILE=/home/oracle/logs/dg_status.log
echo "Data Guard Status Check - date" > $LOGFILE
sqlplus -s / as sysdba <<EOF >> $LOGFILE
SET LINESIZE 200
SELECT DEST_ID, STATUS, ERROR FROM V$ARCHIVE_DEST_STATUS;
EOF
if grep -q "ERROR" $LOGFILE; then
mail -s "ALERT: Data Guard Failure" user@example.com < $LOGFILE
fi
EOF
Schedule via Cron:
/10 * /home/oracle/alert_monitor.sh
🔥 Final Outcome
✅ Highly Available Database with Data Guard ✅ Automated Backups with RMAN ✅ Failover & Switchover using FSFO ✅ Monitoring & Alerts for DR Failures