Home / OCI

OCIHow-toAdvanced

Two-node RAC on OCI Base Database Service: HA design and operations

Deploy a 2-node RAC VM DB system, configure services and SCAN connections with Application Continuity, do rolling patching, and handle node failures without application outages.

Deepak Bhardwaj2 min read

Applies toOCI Base Database Service 2-node RAC VM DB systems, Oracle Database 19c / 23ai Enterprise Edition Extreme Performance

What you get

  • Two VMs in different fault domains, shared ASM storage, Oracle Clusterware.
  • Both instances open the same database (active-active).
  • Rolling patching of OS, Grid Infrastructure and database: no full outage for patches.
  • RAC requires Enterprise Edition Extreme Performance (or BYOL with RAC option) and ASM.

1. Create

Console → Base Database → Create DB system → shape (flexible VM), Node count: 2, Enterprise Edition Extreme Performance, ASM storage. Pick the private subnet; OCI assigns node IPs, VIPs and SCAN IPs.

2. Services: the key to RAC HA

Don't connect apps to the default service. Create a service per workload with preferred instances and failover settings:

srvctl add service -db SALES_xyz -service sales_oltp -preferred SALES1,SALES2 \
  -failovertype TRANSACTION -commit_outcome TRUE -failover_restore LEVEL1 \
  -drain_timeout 300 -stopoption IMMEDIATE -notification TRUE -pdb SALESPDB
srvctl start service -db SALES_xyz -service sales_oltp
srvctl status service -db SALES_xyz

-failovertype TRANSACTION enables Application Continuity (replay of in-flight work after an instance failure for supported drivers). For apps without AC support, use -failovertype SELECT or at least FAN-aware pools.

3. Connection string

(DESCRIPTION=(CONNECT_TIMEOUT=90)(RETRY_COUNT=50)(RETRY_DELAY=3)(TRANSPORT_CONNECT_TIMEOUT=3)
 (ADDRESS=(PROTOCOL=TCP)(HOST=sales-scan.dbsubnet.vcn.oraclevcn.com)(PORT=1521))
 (CONNECT_DATA=(SERVICE_NAME=sales_oltp.dbsubnet.vcn.oraclevcn.com)))

Use the SCAN name, never node IPs. Use the Universal Connection Pool / ODP.NET pool with FAN enabled.

4. Rolling patching

oci db patch list by-db-system --db-system-id <dbsys-ocid> --output table
oci db system patch --db-system-id <dbsys-ocid> --patch-id <patch-ocid> --patch-action APPLY   # GI/OS
oci db database patch --database-id <db-ocid> --patch-id <patch-ocid> --patch-action APPLY   # database

OCI patches one node at a time. Services with -drain_timeout let sessions finish (or move) before an instance stops.

5. Check cluster health

crsctl stat res -t
srvctl status database -db SALES_xyz
srvctl config scan

6. What RAC doesn't cover

Scenario Needed
Instance or node failure RAC (covered)
Fault domain failure RAC across FDs (covered)
Storage corruption / AD outage Data Guard standby in another AD/region
Human error Flashback, backups

Tip

Test node failure with real application load (reboot one node) before go-live. RAC HA only works if the application connects through services and the pool handles FAN events.