DBAtlas · 数据库运维图谱

使用 srvctl 停止/启动 RAC 数据库或单个实例(滚动)

OracleRAC 与 Grid

命令

# 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 mount

作用

通过 Clusterware 有控制地停止/启动数据库或所选实例;使用 -failover 时,被停止实例上的服务会迁移到 available 实例,-drain_timeout 会等待会话排空。

适用场景

用于打补丁、操作系统维护或参数变更期间的滚动(逐节点)重启;用于计划内的整体停机。

注意

在 RAC 中请使用 srvctl 而不是 SQL*Plus SHUTDOWN;否则 Clusterware 不知道资源的 TARGET,可能会重新启动实例。stop database 会关闭所有实例 = 完全停机。如果服务未定义 available 实例,-failover 无法迁移连接。

在 DBAtlas 中打开 →

相关内容