1.启停集群: (需要root用户)
$GRID_HOME/bin/crsctl stop crs
$GRID_HOME/bin/crsctl start crs
2.开启/关闭集群自动启动
$GRID_HOME/bin/crsctl disable crs
$GRID_HOME/bin/crsctl enable crs
3.查看集群名字
$GRID_HOME/bin/cemutlo -n
or
$GRID_HOME/bin/olsnodes -c
4.查看集群版本
$GRID_HOME/bin/crsctl query crs softwareversion hostname
5.查看集群组件状态
$GRID_HOME/bin/crsctl stat res -t
$GRID_HOME/bin/crsctl check crs
$GRID_HOME/bin/crsctl check cssd
$GRID_HOME/bin/crsctl check crsd
$GRID_HOME/bin/crsctl check evmd
6.查看voting disk位置
$GRID_HOME/bin/crsctl query css votedisk
7.查看OCR位置
$GRID_HOME/bin/ocrcheck
8.查看集群私网信息
$GRID_HOME/bin/oifcfg getif
app-ipmp0 172.21.39.128 global public
loypredbib0 172.16.3.192 global cluster_interconnect
loypredbib1 172.16.4.0 global cluster_interconnect
select NAME,IP_ADDRESS from v$cluster_interconnects;
NAME IP_ADDRESS
--------------- ----------------
loypredbib0 172.16.3.19loypredbib1 172.16.4.
9.查看本节点crs状态
crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
10.查看所有crs资源状态
$GRID_HOME/bin/crsctl stat res -t
$GRID_HOME/bin/crsctl stat res -t -init
11.查看集群active version
crsctl query crs activeversion
Oracle Clusterware active version on the cluster is [12.1.0.2.0]
12.启停HAS
crsctl stop has
crsctl start has
13.查看远程节点CRS状态
crsctl check cluster
14.查看voting disk超时(disktimeout)
crsctl get css disktimeout
CRS-4678: Successful get disktimeout 200 for Cluster Synchronization Services.
15.查看私网延迟(Misscount)
crsctl get css misscount
CRS-4678: Successful get misscount 30 for Cluster Synchronization Services.
16.移动voting disk到别的磁盘组
crsctl replace votedisk +OCRVD
Successful addition of voting disk 2e4ded6cee504fc8bf078b080fb7be6f.
Successful addition of voting disk 8e87826024e24fffbf5add65c011fc66.
Successful addition of voting disk e1ba56dedff84fa8bf5605e0302fc81e.
Successful deletion of voting disk 2b7ce864c44d4fecbf60885a188290af.
Successfully replaced voting disk group with +OCRVD.
CRS-4266: Voting file(s) successfully replaced
17.新增votedisk
crsctl add css votedisk
18.删除votedisk
crsctl delete css votedisk
19.查看ocr备份信息
ocrconfig -showbackup
20.查看集群是否为standard或者flex ASM
crsctl get cluster mode status
Cluster is running in "standard" mode
21 .查看crs配置
crsctl config crs
22.单节点集群has命令
crsctl check has
crsctl config has
crsctl disable has
crsctl enable has
crsctl query has releaseversion
crsctl query has softwareversion
crsctl start has
crsctl stop has
开启或者关闭crs开机自动启动
crsctl enable/disable crs开启或者关闭crs开机自动启动
crsctl config crs 显示是否开启了开机启动
--查看crs状态:
[root@VM1 root]# crsctl config crs
CRS-4622: Oracle High Availability Services autostart is enabled.
[root@VM1 root]# pwd
/etc/oracle/scls_scr/vm1/root
[root@VM1 root]# ls -ltr
total 12
-rw-r–r– 1 root root 7 Dec 17 2013 crsstart
-rw-r–r– 1 root oinstall 7 Dec 17 2013 ohasdstr
-rw-r–r– 1 root oinstall 8 Jul 2 18:04 ohasdrun
[root@VM1 root]# cat /etc/oracle/scls_scr/<nodename>/root/ohasdstr
enable
--关闭开机启动,查看文件的状态
[root@VM1 root]# crsctl disable crs
CRS-4621: Oracle High Availability Services autostart is disabled.
[root@VM1 root]# cat ohasdstr
disable
--再次开机自动启动
[root@VM1 root]# crsctl enable crs
CRS-4622: Oracle High Availability Services autostart is enabled.
[root@VM1 root]# cat /etc/oracle/scls_scr/<nodename>/root/ohasdstr
enable
--ohasdrun记录了ohashd的状态,决定是否启动集群
[root@VM1 root]# cat ohasdrun
restart
--停止crs,检查文件状态
[root@VM1 root]# crsctl stop crs
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on ‘vm1’
CRS-2673: Attempting to stop ‘ora.crsd’ on ‘vm1’
[root@VM1 root]# crsctl check crs
CRS-4639: Could not contact Oracle High Availability Services
--查看ohasdrun内容
[root@VM1 root]# cat ohasdrun
stop
--启动crs
[root@VM1 root]# crsctl start crs
CRS-4123: Oracle High Availability Services has been started.
--文件内容被修改为restart
[root@VM1 root]# cat ohasdrun
restart
源网址: modb.pro/db/13473