# 1、停止以及查看数据库
[grid@node1 ~]$
[grid@node1 ~]$ srvctl stop database -d racdb
[grid@node1 ~]$ srvctl status database -d racdb
Instance racdb1 is not running on node node1
Instance racdb2 is not running on node node2
[grid@node1 ~]$ su - root
Password:
Last login: Thu Nov 10 13:26:52 CST 2022 on pts/1
[root@node1 ~]#
[root@node1 ~]# /u01/app/19.3.0/grid/bin/crsctl stop cluster -all
# 2、停止集群服务
# 方法一:
# 关闭集群需要root运行
/u01/app/19.3.0/grid/bin/crsctl stop cluster -all --- 停止所有集群上的节点服务
/u01/app/19.3.0/grid/bin/crsctl stop cluster -- 停止本节点服务
[grid@node1 ~]$ su - root
Password:
Last login: Thu Nov 10 10:30:50 CST 2022 on pts/0
[root@node1 ~]#
[root@node1 ~]# su - grid
Last login: Thu Nov 10 10:48:13 CST 2022
[grid@node1 ~]$ cd $ORACLE_HOME
[grid@node1 grid]$ pwd
/u01/app/19.3.0/grid
[root@node1 u01]# cd /u01/app/19.3.0/grid/bin
[root@node1 ~]#
[root@node1 ~]# /u01/app/19.3.0/grid/bin/crsctl stop cluster -all
CRS-2673: Attempting to stop 'ora.crsd' on 'node1'
CRS-2673: Attempting to stop 'ora.crsd' on 'node2'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on server 'node1'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'node1'
CRS-2673: Attempting to stop 'ora.cvu' on 'node1'
CRS-33673: Attempting to stop resource group 'ora.asmgroup' on server 'node1'
CRS-2673: Attempting to stop 'ora.OCR.dg' on 'node1'
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'node1'
CRS-2673: Attempting to stop 'ora.FRA.dg' on 'node1'
CRS-2673: Attempting to stop 'ora.chad' on 'node1'
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN3.lsnr' on 'node1'
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN2.lsnr' on 'node1'
CRS-2677: Stop of 'ora.OCR.dg' on 'node1' succeeded
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on server 'node2'
CRS-2677: Stop of 'ora.FRA.dg' on 'node1' succeeded
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on 'node2'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'node2'
CRS-2677: Stop of 'ora.DATA.dg' on 'node1' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'node1'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'node1' succeeded
CRS-2673: Attempting to stop 'ora.node1.vip' on 'node1'
CRS-2677: Stop of 'ora.LISTENER_SCAN3.lsnr' on 'node1' succeeded
CRS-2673: Attempting to stop 'ora.scan3.vip' on 'node1'
CRS-2677: Stop of 'ora.LISTENER_SCAN2.lsnr' on 'node1' succeeded
CRS-2673: Attempting to stop 'ora.scan2.vip' on 'node1'
CRS-2677: Stop of 'ora.asm' on 'node1' succeeded
CRS-2673: Attempting to stop 'ora.ASMNET1LSNR_ASM.lsnr' on 'node1'
CRS-2677: Stop of 'ora.node1.vip' on 'node1' succeeded
CRS-2677: Stop of 'ora.cvu' on 'node1' succeeded
CRS-2673: Attempting to stop 'ora.chad' on 'node2'
CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on 'node2' succeeded
CRS-2673: Attempting to stop 'ora.scan1.vip' on 'node2'
CRS-2677: Stop of 'ora.scan3.vip' on 'node1' succeeded
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'node2' succeeded
CRS-2677: Stop of 'ora.scan2.vip' on 'node1' succeeded
CRS-2673: Attempting to stop 'ora.node2.vip' on 'node2'
CRS-2677: Stop of 'ora.node2.vip' on 'node2' succeeded
CRS-2677: Stop of 'ora.scan1.vip' on 'node2' succeeded
CRS-2677: Stop of 'ora.ASMNET1LSNR_ASM.lsnr' on 'node1' succeeded
CRS-2673: Attempting to stop 'ora.asmnet1.asmnetwork' on 'node1'
CRS-2677: Stop of 'ora.asmnet1.asmnetwork' on 'node1' succeeded
CRS-33677: Stop of resource group 'ora.asmgroup' on server 'node1' succeeded.
CRS-2677: Stop of 'ora.chad' on 'node1' succeeded
CRS-33673: Attempting to stop resource group 'ora.asmgroup' on server 'node2'
CRS-2673: Attempting to stop 'ora.OCR.dg' on 'node2'
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'node2'
CRS-2673: Attempting to stop 'ora.FRA.dg' on 'node2'
CRS-2677: Stop of 'ora.chad' on 'node2' succeeded
CRS-2677: Stop of 'ora.FRA.dg' on 'node2' succeeded
CRS-2677: Stop of 'ora.OCR.dg' on 'node2' succeeded
CRS-2677: Stop of 'ora.DATA.dg' on 'node2' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'node2'
CRS-2677: Stop of 'ora.asm' on 'node2' succeeded
CRS-2673: Attempting to stop 'ora.ASMNET1LSNR_ASM.lsnr' on 'node2'
CRS-2677: Stop of 'ora.ASMNET1LSNR_ASM.lsnr' on 'node2' succeeded
CRS-2673: Attempting to stop 'ora.asmnet1.asmnetwork' on 'node2'
CRS-2677: Stop of 'ora.asmnet1.asmnetwork' on 'node2' succeeded
CRS-33677: Stop of resource group 'ora.asmgroup' on server 'node2' succeeded.
CRS-2673: Attempting to stop 'ora.ons' on 'node2'
CRS-2677: Stop of 'ora.ons' on 'node2' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on 'node2'
CRS-2673: Attempting to stop 'ora.ons' on 'node1'
CRS-2677: Stop of 'ora.net1.network' on 'node2' succeeded
CRS-2677: Stop of 'ora.ons' on 'node1' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on 'node1'
CRS-2677: Stop of 'ora.net1.network' on 'node1' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'node1' has completed
CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'node2' has completed
CRS-2677: Stop of 'ora.crsd' on 'node2' succeeded
CRS-2673: Attempting to stop 'ora.storage' on 'node2'
CRS-2673: Attempting to stop 'ora.ctssd' on 'node2'
CRS-2677: Stop of 'ora.crsd' on 'node1' succeeded
CRS-2673: Attempting to stop 'ora.storage' on 'node1'
CRS-2677: Stop of 'ora.storage' on 'node1' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'node1'
CRS-2677: Stop of 'ora.storage' on 'node2' succeeded
CRS-2677: Stop of 'ora.ctssd' on 'node2' succeeded
CRS-2673: Attempting to stop 'ora.evmd' on 'node2'
CRS-2673: Attempting to stop 'ora.asm' on 'node2'
CRS-2677: Stop of 'ora.evmd' on 'node2' succeeded
CRS-2677: Stop of 'ora.asm' on 'node2' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'node2'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'node2' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'node2'
CRS-2677: Stop of 'ora.asm' on 'node1' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'node1'
CRS-2677: Stop of 'ora.cssd' on 'node2' succeeded
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'node1' succeeded
CRS-2673: Attempting to stop 'ora.ctssd' on 'node1'
CRS-2673: Attempting to stop 'ora.evmd' on 'node1'
CRS-2677: Stop of 'ora.ctssd' on 'node1' succeeded
CRS-2677: Stop of 'ora.evmd' on 'node1' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'node1'
CRS-2677: Stop of 'ora.cssd' on 'node1' succeeded
[root@node1 ~]#
# 方法二:
# 停止HAS(High Availability Services),必须以root用户
[root@node1 bin]# /u01/app/19.3.0/grid/bin/crsctl stop has -f -- 停止本节点服务
[root@node1 bin]# /u01/app/19.3.0/grid/bin/crsctl stop has -f
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'node1'
CRS-2673: Attempting to stop 'ora.mdnsd' on 'node1'
CRS-2673: Attempting to stop 'ora.gpnpd' on 'node1'
CRS-2673: Attempting to stop 'ora.crf' on 'node1'
CRS-2677: Stop of 'ora.crf' on 'node1' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'node1'
CRS-2677: Stop of 'ora.mdnsd' on 'node1' succeeded
CRS-2677: Stop of 'ora.gpnpd' on 'node1' succeeded
CRS-2677: Stop of 'ora.gipcd' on 'node1' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'node1' has completed
CRS-4133: Oracle High Availability Services has been stopped.
[root@node1 bin]#
# 方法三
[root@node1 bin]# /u01/app/19.3.0/grid/bin/crsctl stop crs
1、启动集群服务
[root@node1 ~]# /u01/app/19.3.0/grid/bin/crsctl start cluster -all --会启动数据库
或者
[root@node1 ~]# /u01/app/19.3.0/grid/bin/crsctl start has --启动数据库
或者
[root@node1 ~]# /u01/app/19.3.0/grid/bin/crsctl start crs
[root@node1 ~]# /u01/app/19.3.0/grid/bin/crsctl start cluster -all
[root@node1 ~]# /u01/app/19.3.0/grid/bin/crsctl start cluster -all
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'node1'
CRS-2672: Attempting to start 'ora.evmd' on 'node1'
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'node2'
CRS-2672: Attempting to start 'ora.evmd' on 'node2'
CRS-2676: Start of 'ora.cssdmonitor' on 'node1' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'node1'
CRS-2672: Attempting to start 'ora.diskmon' on 'node1'
CRS-2676: Start of 'ora.diskmon' on 'node1' succeeded
CRS-2676: Start of 'ora.cssdmonitor' on 'node2' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'node2'
CRS-2672: Attempting to start 'ora.diskmon' on 'node2'
CRS-2676: Start of 'ora.diskmon' on 'node2' succeeded
CRS-2676: Start of 'ora.evmd' on 'node1' succeeded
CRS-2676: Start of 'ora.evmd' on 'node2' succeeded
CRS-2676: Start of 'ora.cssd' on 'node1' succeeded
CRS-2672: Attempting to start 'ora.cluster_interconnect.haip' on 'node1'
CRS-2672: Attempting to start 'ora.ctssd' on 'node1'
CRS-2676: Start of 'ora.cssd' on 'node2' succeeded
CRS-2672: Attempting to start 'ora.cluster_interconnect.haip' on 'node2'
CRS-2676: Start of 'ora.ctssd' on 'node1' succeeded
CRS-2676: Start of 'ora.cluster_interconnect.haip' on 'node1' succeeded
CRS-2672: Attempting to start 'ora.asm' on 'node1'
CRS-2676: Start of 'ora.cluster_interconnect.haip' on 'node2' succeeded
CRS-2672: Attempting to start 'ora.ctssd' on 'node2'
CRS-2676: Start of 'ora.ctssd' on 'node2' succeeded
CRS-2672: Attempting to start 'ora.asm' on 'node2'
CRS-2676: Start of 'ora.asm' on 'node2' succeeded
CRS-2672: Attempting to start 'ora.storage' on 'node2'
CRS-2676: Start of 'ora.asm' on 'node1' succeeded
CRS-2672: Attempting to start 'ora.storage' on 'node1'
CRS-2676: Start of 'ora.storage' on 'node1' succeeded
CRS-2672: Attempting to start 'ora.crsd' on 'node1'
CRS-2676: Start of 'ora.crsd' on 'node1' succeeded
CRS-2676: Start of 'ora.storage' on 'node2' succeeded
CRS-2672: Attempting to start 'ora.crsd' on 'node2'
CRS-2676: Start of 'ora.crsd' on 'node2' succeeded
[root@node1 ~]#
[root@node1 ~]# su - grid
Last login: Thu Nov 10 15:12:28 CST 2022
[grid@node1 ~]$ srvctl status database -d racdb
Instance racdb1 is not running on node node1
Instance racdb2 is not running on node node2
[grid@node1 ~]$ srvctl start database -d racdb
[grid@node1 ~]$ srvctl status database -d racdb
Instance racdb1 is running on node node1
Instance racdb2 is running on node node2
[grid@node1 ~]$
[root@node1 ~]# su - grid
Last login: Thu Nov 10 15:12:28 CST 2022
[grid@node1 ~]$ srvctl status database -d racdb
Instance racdb1 is not running on node node1
Instance racdb2 is not running on node node2
[grid@node1 ~]$ srvctl start database -d racdb
[grid@node1 ~]$ srvctl status database -d racdb
Instance racdb1 is running on node node1
Instance racdb2 is running on node node2
[grid@node1 ~]$