温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Oracle如何查询当前的crs/has自启动状态

发布时间:2021-07-25 13:55:33 来源:亿速云 阅读:454 作者:小新 栏目:数据库

这篇文章主要介绍了Oracle如何查询当前的crs/has自启动状态,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。

前言

我们知道在某些停机测试场景,是需要人为禁用crs/has的自启动的,防止过程中主机反复重启对数据库集群造成影响。
使用crsctl disable/enable crs命令可以禁用/启用crs的自启动,但没有命令去查看当前自启动状态,虽然命令可以反复执行,但看不到实际状态总归还是让人不放心。

我在Linux测试环境下试了几个Oracle RAC版本:

  • Oracle RAC 10.2.0.5

  • Oracle RAC 11.2.0.4

  • Oracle RAC 12.1.0.2

发现对于Oracle RAC 10.2.0.5来说:

使用root用户crsctl disable/enable crs时,改变的是这个文件的值:

--10.2.0.5
[root@rac1-server ~]# /s01/oracle/product/10.2.0/crs_1/bin/crsctl disable crs
[root@rac1-server ~]# more /etc/oracle/scls_scr/rac1-server/root/crsstart 
disable
[root@rac1-server ~]# /s01/oracle/product/10.2.0/crs_1/bin/crsctl enable crs
[root@rac1-server ~]# more /etc/oracle/scls_scr/rac1-server/root/crsstart 
enable

对于Oracle RAC 11.2.0.4和Oracle RAC 12.1.0.2来说:

使用root用户crsctl disable/enable crs时,改变的是这个文件的值:

--11.2.0.4
[root@db01 ~]# /opt/app/11.2.0/grid/bin/crsctl disable crs
CRS-4621: Oracle High Availability Services autostart is disabled.
[root@db01 ~]# more /etc/oracle/scls_scr/db01/root/ohasdstr 
disable
[root@db01 ~]# /opt/app/11.2.0/grid/bin/crsctl enable crs
CRS-4622: Oracle High Availability Services autostart is enabled.
[root@db01 ~]# more /etc/oracle/scls_scr/db01/root/ohasdstr 
enable

--12.1.0.2
[root@oemapp1 ~]# /app/12.1.0.2/grid/bin/crsctl disable crs
CRS-4621: Oracle High Availability Services autostart is disabled.
[root@oemapp1 ~]# more /etc/oracle/scls_scr/oemapp1/root/ohasdstr 
disable
[root@oemapp1 ~]# /app/12.1.0.2/grid/bin/crsctl enable crs
CRS-4622: Oracle High Availability Services autostart is enabled.
[root@oemapp1 ~]# more /etc/oracle/scls_scr/oemapp1/root/ohasdstr 
enable

基本上可以认定是10.2.0.5版本,都是去对应crsstart这个文件的值。11.2.0.4和12.1.0.2版本都是去对应ohasdstr这个文件值。

对于主流的小机环境:

对于AIX系统,跟Linux的配置文件路径没有区别;

而对于SUN Solaris和HP-UX,需要注意配置文件的路径有所区别(/etc/oracle/.. -> /var/opt/oracle/..):

--10.2.0.5
/var/opt/oracle/scls_scr/$hostname/root/crsstart
--11.2.0.4
/var/opt/oracle/scls_scr/$hostname/root/ohasdstr

感谢你能够认真阅读完这篇文章,希望小编分享的“Oracle如何查询当前的crs/has自启动状态”这篇文章对大家有帮助,同时也希望大家多多支持亿速云,关注亿速云行业资讯频道,更多相关知识等着你来学习!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI