Stop / start a RAC database or a single instance with srvctl (rolling)
OracleRAC & GridCommand
# Whole database (all instances):
srvctl stop database -db <db_unique_name> -stopoption immediate
srvctl start database -db <db_unique_name>
# Rolling maintenance: stop one instance, moving its services to the other instances
srvctl stop instance -db <db_unique_name> -instance <instance> \
-stopoption immediate -drain_timeout 300 -failover
srvctl start instance -db <db_unique_name> -instance <instance>
# By node:
srvctl stop instance -db <db_unique_name> -node <node> -stopoption immediate
# Start in a specific open mode (e.g. a physical standby in mount):
srvctl start database -db <db_unique_name> -startoption mountWhat it does
Stops/starts the database or the selected instance in a controlled way through Clusterware; with -failover the services on the stopped instance move to available instances, and -drain_timeout waits for sessions to drain.
When to use it
For rolling (node by node) restarts during patching, OS maintenance or parameter changes; for a planned full shutdown.
Caution
In RAC use srvctl instead of SQL*Plus SHUTDOWN; otherwise Clusterware does not know the resource TARGET and may restart the instance. stop database shuts down all instances = full outage. If services have no available instances defined, -failover cannot move the connections.
Related
- Check RAC database, instance and service status with srvctl
- Add a RAC service with preferred/available instances (including Application Continuity)
- 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)