ORACLE 11g RAC 集群的管理与维护(3) —— crsctl 命令之(三) :管理 crs

ORACLE 11g RAC 集群的管理与维护(3) —— crsctl 命令之(三) :管理 crs

CRS(Cluster Ready Service,集群就绪服务)。CRS 主要完成集群成员管理、心跳监控、故障切换等功能。通过 CRS 将多个节点的操作系统绑定到一起,客户端对集群的访问就像访问一台服务器一样。CRS 包括 voting disk(表决磁盘) 和 Oracle Cluster Registry(OCR,Oracle 集群注册服务)。

(1)voting disk(表决磁盘):表决磁盘放在共享存储,以保证每个节点都能访问。当集群节点发生故障时,通过表决磁盘进行投票仲裁。
(2)Oracle Cluster Registry(OCR,集群注册服务):用于记录 RAC 集群和数据库的配置信息。包括集群节点的列表、集群数据库实例到节点的映射以及 CRS 应用程序资源信息。

一、查询 CRS 的相关信息

1、crsctl query crs administrator

查询具有 Oracle Clusterware 管理权限的用户列表:

[root@rac1 bin]# pwd
/u01/app/11.2.0/grid/bin

[root@rac1 bin]# ./crsctl query crs administrator
CRS Administrator List: *
2、crsctl query crs activeversion

查询集群中运行的 Oracle Clusterware 软件的 activex 版本:

[root@rac1 bin]# pwd
/u01/app/11.2.0/grid/bin

[root@rac1 bin]# ./crsctl query crs activeversion
Oracle Clusterware active version on the cluster is [11.2.0.4.0]
3、crsctl query crs releaseversion

查询本地节点上二进制文件中存储的 Oracle Clusterware 软件的版本:

[root@rac1 bin]# pwd
/u01/app/11.2.0/grid/bin

[root@rac1 bin]# ./crsctl query crs releaseversion
Oracle High Availability Services release version on the local node is [11.2.0.4.0]
4、crsctl query crs softwareversion

查询在当前节点或指定节点上成功启动的软件的最新版本:

[root@rac1 bin]# pwd
/u01/app/11.2.0/grid/bin

[root@rac1 bin]# ./crsctl query crs softwareversion
Oracle Clusterware version on node [rac1] is [11.2.0.4.0]

[root@rac1 bin]# ./crsctl query crs softwareversion rac1
Oracle Clusterware version on node [rac1] is [11.2.0.4.0]

[root@rac1 bin]# ./crsctl query crs softwareversion rac2
Oracle Clusterware version on node [rac2] is [11.2.0.4.0]
5、crsctl check crs

查询本地服务器上 OHAS 和 Oracle Clusterware 的状态:

[root@rac1 bin]# pwd
/u01/app/11.2.0/grid/bin

[root@rac1 bin]# ./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
6、crsctl config crs

查询 HAS 自动启动配置:

[root@rac1 bin]# pwd
/u01/app/11.2.0/grid/bin

[root@rac1 bin]# ./crsctl config crs
CRS-4622: Oracle High Availability Services autostart is enabled.

二、禁用和启用 CRS 的自动启动配置

1、rsctl disable crs

禁用 CRS 的自动启动配置:

[root@rac1 bin]# pwd
/u01/app/11.2.0/grid/bin

[root@rac1 bin]# ./crsctl disable crs
CRS-4621: Oracle High Availability Services autostart is disabled.

[root@rac1 bin]# ./crsctl config crs
CRS-4621: Oracle High Availability Services autostart is disabled.
2、crsctl enable crs

启用 CRS 的自动启动配置:

[root@rac1 bin]# pwd
/u01/app/11.2.0/grid/bin

[root@rac1 bin]# ./crsctl enable crs
CRS-4622: Oracle High Availability Services autostart is enabled.

[root@rac1 bin]# ./crsctl config crs
CRS-4622: Oracle High Availability Services autostart is enabled.

三、启动和停止本地服务器上的 CRS

1、crsctl stop crs [-f]

停止本地服务器上的 CRS:

[root@rac1 bin]# pwd
/u01/app/11.2.0/grid/bin

[root@rac1 bin]# ./crsctl stop crs -f
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'rac1'
CRS-2673: Attempting to stop 'ora.crsd' on 'rac1'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'rac1'
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on 'rac1'
CRS-2673: Attempting to stop 'ora.OCR.dg' on 'rac1'
CRS-2673: Attempting to stop 'ora.orcl.db' on 'rac1'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'rac1'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.rac1.vip' on 'rac1'
CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.scan1.vip' on 'rac1'
CRS-2677: Stop of 'ora.rac1.vip' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.rac1.vip' on 'rac2'
CRS-2677: Stop of 'ora.scan1.vip' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.scan1.vip' on 'rac2'
CRS-2677: Stop of 'ora.orcl.db' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.BAK.dg' on 'rac1'
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'rac1'
CRS-2676: Start of 'ora.rac1.vip' on 'rac2' succeeded
CRS-2676: Start of 'ora.scan1.vip' on 'rac2' succeeded
CRS-2672: Attempting to start 'ora.LISTENER_SCAN1.lsnr' on 'rac2'
CRS-2677: Stop of 'ora.DATA.dg' on 'rac1' succeeded
CRS-2677: Stop of 'ora.BAK.dg' on 'rac1' succeeded
CRS-2677: Stop of 'ora.OCR.dg' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'rac1'
CRS-2677: Stop of 'ora.asm' on 'rac1' succeeded
CRS-2676: Start of 'ora.LISTENER_SCAN1.lsnr' on 'rac2' succeeded
CRS-2673: Attempting to stop 'ora.ons' on 'rac1'
CRS-2677: Stop of 'ora.ons' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on 'rac1'
CRS-2677: Stop of 'ora.net1.network' on 'rac1' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'rac1' has completed
CRS-2677: Stop of 'ora.crsd' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.crf' on 'rac1'
CRS-2673: Attempting to stop 'ora.ctssd' on 'rac1'
CRS-2673: Attempting to stop 'ora.evmd' on 'rac1'
CRS-2673: Attempting to stop 'ora.asm' on 'rac1'
CRS-2673: Attempting to stop 'ora.mdnsd' on 'rac1'
CRS-2677: Stop of 'ora.evmd' on 'rac1' succeeded
CRS-2677: Stop of 'ora.mdnsd' on 'rac1' succeeded
CRS-2677: Stop of 'ora.crf' on 'rac1' succeeded
CRS-2677: Stop of 'ora.ctssd' on 'rac1' succeeded
CRS-2677: Stop of 'ora.asm' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'rac1'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'rac1'
CRS-2677: Stop of 'ora.cssd' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'rac1'
CRS-2677: Stop of 'ora.gipcd' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.gpnpd' on 'rac1'
CRS-2677: Stop of 'ora.gpnpd' on 'rac1' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'rac1' has completed
CRS-4133: Oracle High Availability Services has been stopped.

说明:
(1)该命令试图停止 Oracle Clusterware 管理的资源,同时试图停止本地服务器上的 OHAS。
(2)如果在运行 crsctl stop crs 命令之后,Oracle Clusterware 管理的任何资源仍在运行,那么该命令将失败。
(3)使用 -f 选项暂停所有资源并停止本地服务器上的 OHAS。
(4)如果打算在所有节点或节点列表上停止 Oracle Clusterware,需要使用 crsctl stop cluster 命令。

2、crsctl start crs

启动本地服务器上的 CRS:

[root@rac1 bin]# pwd
/u01/app/11.2.0/grid/bin

[root@rac1 bin]# ./crsctl start crs
CRS-4123: Oracle High Availability Services has been started.

[root@rac1 bin]# ./crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4535: Cannot communicate with Cluster Ready Services
CRS-4529: Cluster Synchronization Services is online
CRS-4534: Cannot communicate with Event Manager
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

睿思达DBA_WGX

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值