Subchapter 72.10
references/ha-dr.mdMarkdown5 KBView on GitHub
aws rds modify-db-instance \
--db-instance-identifier <instance-id> \
--multi-az \
--apply-immediatelyUses IBM Db2 HADR in SUPERASYNC mode. Asynchronous replication — some data loss possible.
| Feature | RPO | RTO |
|---|---|---|
| Multi-AZ | 0 | 1–2 min |
| Standby replica (in-region or cross-region) | Seconds | Minutes |
| PiTR (in-region) | ~5 min | Hours |
| PiTR (cross-region) | ~25 min | Hours |
customer_id and site_id required)rdsadmin stored procedure operations (create/drop/restore/rollforward) must complete before creating replicaRDS Console → Databases → select instance → Actions → Create replica → Replica mode: Standby → choose region
aws rds create-db-instance-read-replica \
--db-instance-identifier <replica-name> \
--source-db-instance-identifier arn:aws:rds:<source-region>:<account>:db:<primary-name> \
--db-parameter-group-name <param-group-in-dr-region> \
--replica-mode mounted \
--kms-key-id <kms-key-arn> \
--region <dr-region># Console: Databases → select replica → Actions → Promote
aws rds promote-read-replica \
--db-instance-identifier <replica-name> \
--region <dr-region>After promotion, connect to the promoted instance:
db2 catalog TCPIP node <node_name> remote <promoted-endpoint> server <port>
db2 catalog database <dbname> as <alias> at node <node_name>
db2 connect to <dbname> user <master-user> using '<password>'# CloudWatch metric: ReplicaLag (seconds)
aws cloudwatch get-metric-statistics \
--namespace AWS/RDS \
--metric-name ReplicaLag \
--dimensions Name=DBInstanceIdentifier,Value=<replica-name> \
--start-time $(date -u -d '1 hour ago' +%Y-%m-%dT%H:%M:%SZ) \
--end-time $(date -u +%Y-%m-%dT%H:%M:%SZ) \
--period 60 \
--statistics AverageSet a CloudWatch alarm when ReplicaLag exceeds your RTO threshold.
BLOCKNONLOGGED and LOGINDEXBUILD are set to YES on primary automaticallyaws rds delete-db-instance \
--db-instance-identifier <replica-name> \
--skip-final-snapshot \
--region <dr-region>Force a failover to the standby (Multi-AZ):
aws rds reboot-db-instance \
--db-instance-identifier <instance-id> \
--force-failoverAfter a Multi-AZ failover, the primary moves to the standby’s AZ. To minimize latency, deploy application servers in the same AZ as the current primary.
Check current AZ of the primary:
aws rds describe-db-instances \
--db-instance-identifier <instance-id> \
--query 'DBInstances[0].AvailabilityZone' \
--output textUse Amazon Route 53 ARC (Application Recovery Controller) to automate traffic routing without changing application endpoints. See: https://aws.amazon.com/blogs/database/configure-amazon-rds-for-db2-standby-replicas-for-high-availability-and-faster-disaster-recovery/ (opens in a new tab)
For the full application-tier colocation pattern — an Auto Scaling group spanning both AZs behind an ALB, EventBridge failover-event alerting, and connecting via the RDS endpoint rather than IPs — see colocation.md.
RDS for Db2 supports read replicas as a separate feature. Read replicas allow read-only workloads to be offloaded from the primary instance. Standby replicas (DR replicas in mounted/HADR mode) cannot serve reads while in standby mode — they must be promoted to a standalone instance for read/write operations.