需要维修主机, 上面是 RAC 的备节点. 变更内容为起停这个节点的数据库实例和 crs 集群. 实际操作的时候很顺利, 没什么问题:
一, 关闭:
1 关闭实例
- sqlplus / as sysdba
- shutdown immediate
rac 的实例也可以像单节点一样关闭,
另一种方式是 srvctl stop instance -d racdb -i racdb2 -o immediate
2 关闭 crs
crsctl stop crs
这个命令只会关闭当前节点的 crs
实际操作时使用 Oracle 用户并在全路径下执行时报错, 权限不足.
由于已有 root 用户, 使用 root 用户关闭了集群.
二, 启动
1 开启 crs
默认情况下 crs 会随操作系统启动, 实际变更操作时, 等待大约十分钟后, crs 和实例都正常启动.
若没有正常启动, 或需要手动启动时, 命令如下:
crsctl start crs
2 启动实例
- sqlplus / as sysdba
- startup
另一种方式是 srvctl start instance -d racdb -i racdb2 -o immediate
查看 cluster 资源状态
- [oracle@traracdb2 ~]$ /App/11.2.0/grid/bin/crsctl status resource -t
- --------------------------------------------------------------------------------
- NAME TARGET STATE SERVER STATE_DETAILS
- --------------------------------------------------------------------------------
- Local Resources
- --------------------------------------------------------------------------------
- ora.ARCH.dg
- ONLINE ONLINE traracdb1
- ONLINE ONLINE traracdb2
- ora.DATA.dg
- ONLINE ONLINE traracdb1
- ONLINE ONLINE traracdb2
- ora.LISTENER.lsnr
- ONLINE ONLINE traracdb1
- ONLINE ONLINE traracdb2
- ora.OCR.dg
- ONLINE ONLINE traracdb1
- ONLINE ONLINE traracdb2
- ora.asm
- ONLINE ONLINE traracdb1 Started
- ONLINE ONLINE traracdb2 Started
- ora.gsd
- OFFLINE OFFLINE traracdb1
- OFFLINE OFFLINE traracdb2
- ora.net1.network
- ONLINE ONLINE traracdb1
- ONLINE ONLINE traracdb2
- ora.ons
- ONLINE ONLINE traracdb1
- ONLINE ONLINE traracdb2
- --------------------------------------------------------------------------------
- Cluster Resources
- --------------------------------------------------------------------------------
- ora.LISTENER_SCAN1.lsnr
- 1 ONLINE ONLINE traracdb1
- ora.cvu
- 1 ONLINE ONLINE traracdb1
- ora.oc4j
- 1 ONLINE ONLINE traracdb1
- ora.scan1.vip
- 1 ONLINE ONLINE traracdb1
- ora.racdb.db
- 1 ONLINE ONLINE traracdb1 Open
- 2 ONLINE ONLINE traracdb2 Open
- ora.racdb.dg_rac.svc
- 1 ONLINE OFFLINE
- ora.racdb.rac.svc
- 1 ONLINE ONLINE traracdb1
- ora.traracdb1.vip
- 1 ONLINE ONLINE traracdb1
- ora.traracdb2.vip
- 1 ONLINE ONLINE traracdb2
来源: http://www.linuxidc.com/Linux/2019-05/158737.htm