Add a RAC service with preferred/available instances (including Application Continuity)
OracleRAC & GridCommand
srvctl add service -db <db_unique_name> -service <service> \
-preferred <inst1>,<inst2> -available <inst3> \
-pdb <pdb> -role PRIMARY -policy AUTOMATIC \
-failovertype TRANSACTION -commit_outcome TRUE \
-failoverretry 30 -failoverdelay 10 \
-clbgoal SHORT -rlbgoal SERVICE_TIME -notification TRUE \
-drain_timeout 300 -stopoption IMMEDIATE
srvctl start service -db <db_unique_name> -service <service>
# Verify:
srvctl config service -db <db_unique_name> -service <service>
srvctl status service -db <db_unique_name> -service <service>What it does
Defines a service for applications that normally runs on the preferred instances and moves to an available instance when they fail; with -role PRIMARY it starts only in the primary role under Data Guard.
When to use it
To connect applications to a service rather than an instance, to partition workloads across nodes, and to enable seamless failover (drain/failover) during planned maintenance.
Caution
Applications must connect with this service name (through SCAN), not with a SID or instance name. -failovertype TRANSACTION (Application Continuity) requires application/driver support; if unsure, start with -failovertype SELECT (TAF) or NONE. Do not use SYS$ services or the default service named after db_unique_name for applications.
Related
- Check RAC database, instance and service status with srvctl
- Stop / start a RAC database or a single instance with srvctl (rolling)
- Relocate a RAC service to another instance
- Check cluster resource status (crsctl stat res -t)
- Check cluster stack health, the node list and the Clusterware version
- Check OCR integrity and take an OCR backup (ocrcheck / ocrconfig)