srvctl和crs_start命令无法启动oracle RAC实例, 但sqlplus可以启动

今天遇到一个奇怪问题,发现srvctl和crs_start命令无法启动Oracle RAC实例,但用sqlplus却可以正常启动。最终发现原因是在OCR中数据库的状态变成了disable,将此状态更改为enable后恢复正常。

以下是一个模拟示例:

[email protected]:~ $> crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora....SM1.asm application    ONLINE    ONLINE    his0...rc01
ora....01.lsnr application    ONLINE    ONLINE    his0...rc01
ora....c01.gsd application    ONLINE    ONLINE    his0...rc01
ora....c01.ons application    ONLINE    ONLINE    his0...rc01
ora....c01.vip application    ONLINE    ONLINE    his0...rc01
ora....SM2.asm application    ONLINE    ONLINE    his0...rc02
ora....02.lsnr application    ONLINE    ONLINE    his0...rc02
ora....c02.gsd application    ONLINE    ONLINE    his0...rc02
ora....c02.ons application    ONLINE    ONLINE    his0...rc02
ora....c02.vip application    ONLINE    ONLINE    his0...rc02
ora....rcdb.db application    OFFLINE   OFFLINE
ora....b1.inst application    OFFLINE   OFFLINE
ora....b2.inst application    OFFLINE   OFFLINE

[email protected]:~ $> ps -ef | grep ora_
  oracle 23001 16923   0 16:31:27 pts/1       0:00 grep ora_

[email protected]:~ $> crs_start ora.hisdrcdb.hisdrcdb2.inst
Attempting to start `ora.hisdrcdb.hisdrcdb2.inst` on member `his00mlcdrc02`
Start of `ora.hisdrcdb.hisdrcdb2.inst` on member `his00mlcdrc02` failed.    (在节点his00mlcdrc02上启动失败)
his00mlcdrc01 : CRS-1019: Resource ora.hisdrcdb.hisdrcdb2.inst (application) cannot run on his00mlcdrc01
(对于象VIP这类可以failover到其它节点的资源,如果在原节点上启动不成功,则Oracle会试图在其它节点上启动。而实例是不能failover的资源,此处提示实例2不能在节点1上启动)
CRS-0215: Could not start resource ‘ora.hisdrcdb.hisdrcdb2.inst‘.
[email protected]:~ $> crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora....SM1.asm application    ONLINE    ONLINE    his0...rc01
ora....01.lsnr application    ONLINE    ONLINE    his0...rc01
ora....c01.gsd application    ONLINE    ONLINE    his0...rc01
ora....c01.ons application    ONLINE    ONLINE    his0...rc01
ora....c01.vip application    ONLINE    ONLINE    his0...rc01
ora....SM2.asm application    ONLINE    ONLINE    his0...rc02
ora....02.lsnr application    ONLINE    ONLINE    his0...rc02
ora....c02.gsd application    ONLINE    ONLINE    his0...rc02
ora....c02.ons application    ONLINE    ONLINE    his0...rc02
ora....c02.vip application    ONLINE    ONLINE    his0...rc02
ora....rcdb.db application    OFFLINE   OFFLINE
ora....b1.inst application    OFFLINE   OFFLINE
ora....b2.inst application    ONLINE    OFFLINE
此时可以看到实例2启动并未成功。

[email protected]:~ $> srvctl start instance -d hisdrcdb -i hisdrcdb2
用srvctl命令尝试启动实例2,命令很快就返回了。

[email protected]:~ $> crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora....SM1.asm application    ONLINE    ONLINE    his0...rc01
ora....01.lsnr application    ONLINE    ONLINE    his0...rc01
ora....c01.gsd application    ONLINE    ONLINE    his0...rc01
ora....c01.ons application    ONLINE    ONLINE    his0...rc01
ora....c01.vip application    ONLINE    ONLINE    his0...rc01
ora....SM2.asm application    ONLINE    ONLINE    his0...rc02
ora....02.lsnr application    ONLINE    ONLINE    his0...rc02
ora....c02.gsd application    ONLINE    ONLINE    his0...rc02
ora....c02.ons application    ONLINE    ONLINE    his0...rc02
ora....c02.vip application    ONLINE    ONLINE    his0...rc02
ora....rcdb.db application    OFFLINE   OFFLINE
ora....b1.inst application    OFFLINE   OFFLINE
ora....b2.inst application    ONLINE    OFFLINE
srvctl命令启动也不成功。

[email protected]:~ $> sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.4.0 - Production on Sat Oct 9 16:37:38 2010

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.

Connected to an idle instance.

SQL> startup;
ORACLE instance started.

Total System Global Area 1610612736 bytes
Fixed Size                  2139192 bytes
Variable Size             399465416 bytes
Database Buffers         1174405120 bytes
Redo Buffers               34603008 bytes
Database mounted.
Database opened.
SQL> show parameter instance_name

NAME                                 TYPE                   VALUE
------------------------------------ ---------------------- ------------------------------
instance_name                        string                 hisdrcdb2
SQL> select open_mode from v$database;

OPEN_MODE
--------------------
READ WRITE
用sqlplus启动实例成功了。

SQL> host crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora....SM1.asm application    ONLINE    ONLINE    his0...rc01
ora....01.lsnr application    ONLINE    ONLINE    his0...rc01
ora....c01.gsd application    ONLINE    ONLINE    his0...rc01
ora....c01.ons application    ONLINE    ONLINE    his0...rc01
ora....c01.vip application    ONLINE    ONLINE    his0...rc01
ora....SM2.asm application    ONLINE    ONLINE    his0...rc02
ora....02.lsnr application    ONLINE    ONLINE    his0...rc02
ora....c02.gsd application    ONLINE    ONLINE    his0...rc02
ora....c02.ons application    ONLINE    ONLINE    his0...rc02
ora....c02.vip application    ONLINE    ONLINE    his0...rc02
ora....rcdb.db application    OFFLINE   OFFLINE
ora....b1.inst application    OFFLINE   OFFLINE
ora....b2.inst application    ONLINE    OFFLINE
但crs_stat显示的状态仍然是OFFLINE.

先把实例2停止。
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options

[email protected]:~ $> ocrdump

查看OCRDUMPFILE

......
[DATABASE.DATABASES.hisdrcdb.ENABLED]
ORATEXT : false
SECURITY : {USER_PERMISSION : PROCR_ALL_ACCESS, GROUP_PERMISSION : PROCR_WRITE, OTHER_PERMISSION : PROCR_READ, USER_NAME : oracle, GROUP_NAME : dba}

[DATABASE.DATABASES.hisdrcdb.POLICY]
ORATEXT : MANUAL
SECURITY : {USER_PERMISSION : PROCR_ALL_ACCESS, GROUP_PERMISSION : PROCR_WRITE, OTHER_PERMISSION : PROCR_READ, USER_NAME : oracle, GROUP_NAME : dba}
......
OCR中显示数据库DATABASE.DATABASES.hisdrcdb.ENABLED属性为false,DATABASE.DATABASES.hisdrcdb.POLICY为manual,而在别的数据库上可以看到这两个属性应为true和automatic.

[email protected]:~ $> srvctl status database -d hisdrcdb -f
Instance hisdrcdb1 is disabled
Instance hisdrcdb1 is not running on node his00mlcdrc01
Instance hisdrcdb2 is disabled
Instance hisdrcdb2 is not running on node his00mlcdrc02
srvctl状态表明数据库被disable了。

[email protected]:~ $> srvctl enable database -d hisdrcdb
[email protected]:~ $> srvctl status database -d hisdrcdb -f
Instance hisdrcdb1 is not running on node his00mlcdrc01
Instance hisdrcdb2 is not running on node his00mlcdrc02
用srvctl命令enable database

[email protected]:~ $> ocrdump ocr1
查看ocr1:
......
[DATABASE.DATABASES.hisdrcdb.ENABLED]
ORATEXT : true
SECURITY : {USER_PERMISSION : PROCR_ALL_ACCESS, GROUP_PERMISSION : PROCR_WRITE, OTHER_PERMISSION : PROCR_READ, USER_NAME : oracle, GROUP_NAME : dba}

[DATABASE.DATABASES.hisdrcdb.POLICY]
ORATEXT : AUTOMATIC
SECURITY : {USER_PERMISSION : PROCR_ALL_ACCESS, GROUP_PERMISSION : PROCR_WRITE, OTHER_PERMISSION : PROCR_READ, USER_NAME : oracle, GROUP_NAME : dba}
......
此时这两个属性恢复为true和automatic.

[email protected]:~ $> crs_start ora.hisdrcdb.hisdrcdb1.inst
Attempting to start `ora.hisdrcdb.hisdrcdb1.inst` on member `his00mlcdrc01`
Start of `ora.hisdrcdb.hisdrcdb1.inst` on member `his00mlcdrc01` succeeded.
[email protected]:~ $>
[email protected]:~ $> crs_start ora.hisdrcdb.hisdrcdb2.inst
Attempting to start `ora.hisdrcdb.hisdrcdb2.inst` on member `his00mlcdrc02`
Start of `ora.hisdrcdb.hisdrcdb2.inst` on member `his00mlcdrc02` succeeded.
[email protected]:~ $> crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora....SM1.asm application    ONLINE    ONLINE    his0...rc01
ora....01.lsnr application    ONLINE    ONLINE    his0...rc01
ora....c01.gsd application    ONLINE    ONLINE    his0...rc01
ora....c01.ons application    ONLINE    ONLINE    his0...rc01
ora....c01.vip application    ONLINE    ONLINE    his0...rc01
ora....SM2.asm application    ONLINE    ONLINE    his0...rc02
ora....02.lsnr application    ONLINE    ONLINE    his0...rc02
ora....c02.gsd application    ONLINE    ONLINE    his0...rc02
ora....c02.ons application    ONLINE    ONLINE    his0...rc02
ora....c02.vip application    ONLINE    ONLINE    his0...rc02
ora....rcdb.db application    ONLINE    ONLINE    his0...rc02
ora....b1.inst application    ONLINE    ONLINE    his0...rc01
ora....b2.inst application    ONLINE    ONLINE    his0...rc02
再次用crs_start命令则能够正常启动实例。

附:srvctl disable disables target, meaning CRS will not consider it for automatic startup, failover, or restart. This option is useful to ensure an object that is down for maintenance is not accidentally automatically restarted.

srvctl enable reenables the specified object.
时间: 2024-12-10 13:57:13

srvctl和crs_start命令无法启动oracle RAC实例, 但sqlplus可以启动的相关文章

Oracle RAC 实例管理(Cluster Group Service)

CGS是Oracle RAC 实例管理的实现方法,负责实现如下功能 1)实例之间的心跳机制 2)当实例离开或者加入集群时完成数据库集群的重新配置 3)解决数据库层面出现的脑裂 1,网络心跳 数据库层面的网络心跳是通过LMON进程实现的,每个实例的LMON进程会定期通过数据库的私网与所有远程实例进行通信,以确认其他实例的状态,如果,某一个实例一段时间之内不能够响应其他节点发送的网络心跳信息,那么数据库集群就需要进行重新配置,用户能够看到的最直观的信息就是ora-29740错误. 2,磁盘心跳 数据

ORACLE RAC 11.2.0.4启动后报ORA-01172、ORA-01151错误

环境描述 操作系统:redhat6.4 64位 oracle版本:11.2.0.4 RAC(两节点) 盘阵:宏彬3300e 问题描述 年前实施RAC集群时,在rac集群所在的操作系统中只有一组路径,另外一组冗余路径没显示出来,但RAC能正常启动,因为时间关系,并没有去解决,直接shutdown RAC集群所在服务器.年后到现场,发现了启动文件集群发现了此问题,把一组光纤的两个小头在光纤交换机上交换一下即可,接着启动RAC集群时,发现存储的路径映射多一组冗余路径,但数据库启动不了,报错 ORA-0

【转载】Oracle RAC常用维护工具和命令

Oracle 的管理可以通过OEM或者命令行接口.Oracle Clusterware的命令集可以分为以下4种: 节点层:osnodes 网络层:oifcfg 集群层:crsctl, ocrcheck,ocrdump,ocrconfig 应用层:srvctl,onsctl,crs_stat 下面分别来介绍这些命令. 一. 节点层只有一个命令: osnodes, 这个命令用来显示集群点列表,可用的参数如下,这些参数可以混合使用.[[email protected] bin]# ./olsnodes

ORACLE RAC 11g的搭建安装完全手册(适用于RedHat 6.4)

说明:因工作需要,苦练RAC安装.在百度狂搜之后,发现还没有一份完整版的,适合新手搭建RAC 11G环境的安装手册. 本安装步骤手册通过本人根据实践,整理后的真实安装步骤. 在通过对RAC 10g和11g进行安装,发现还有有些区别.在RAC 11g中,RAC已经被整合到oracle grid infrastructure.下面是整个安装步骤,与需要的朋友分享下.      安装环境列表: 1.VMwave 9.0 64位虚拟机 2.安装2台操作系统:RedHat 6.4 64bit 3.orac

命令行重启Oracle数据库

Linux下重启oracle数据库: 首先以root用户登录,输入以下命令 1.su – oralce                                     --切换到oracle用户 2.lsnrctl stop                                   --停止监听 3.sqlplus "/as sysdba"                  --以sysdba用户登录oracle 4.shutdown immediate       

oracle rac的启动与停止

引言:这写篇文章的出处是因为我的一名学生最近在公司搭建RAC集群,但对其启动与关闭的顺序和原理不是特别清晰,我在教学工作中也发现了很多学员对RAC知识了解甚少,因此我在这里就把RAC里面涉及到的最常用的启动与关闭顺序和命令逐一列举出来,由于RAC的后台资源较多,因此涉及到的命令也很多,最后附上帮助手册让在工作中临时使用时也可以迅速查到,如果这篇文章能够帮到大家就是我今后继续努力撰写的动力,感谢大家对我文章的浏览多提宝贵意见. 11G RAC启动关闭简单的多. 关闭:1,oracle用户关闭服务.

Oracle RAC 常用维护工具和命令

Oracle RAC 常用维护工具和命令 分类: Oracle Basic Knowledge Oracle RAC2010-03-09 01:02 13987人阅读 评论(6) 收藏 举报 oracle工具数据库集群moduleoracle10g Oracle 的管理可以通过OEM或者命令行接口. Oracle Clusterware的命令集可以分为以下4种: 节点层:osnodes 网络层:oifcfg 集群层:crsctl, ocrcheck,ocrdump,ocrconfig 应用层:s

(转)Oracle RAC日常管理命令

转自:http://www.xuebuyuan.com/1206937.html 一.查看RAC环境 RAC架构,2节点信息 节点1 SQL> show parameter instance NAME TYPE VALUE ------------------------------------ ----------- ----------------------------------------------- active_instance_count integer cluster_dat

Oracle RAC启动及关闭步骤

Oracle RAC的关闭及启动,需要严格按照步骤来执行,以下就以一套实际的系统为例,来介绍RAC的关闭及启动过程: 环境说明 主机名 实例名 监听端口 字符集 db-node1 orcl1 1521 ZHS16GBK db-node2 orcl2 1521 ZHS16GBK 关闭 顺序:关闭数据库(实例)-> 关闭ASM实例 -> 关闭节点服务 查看状态:   $ srvctl status database -d orcl Instance orcl1 is running on node