ORA-29701 / CRS-4124 Oracle ASM start failed

本文详细介绍了当遇到OracleHighAvailabilityServices启动失败时的解决方案,包括使用rootHas.pl脚本进行配置和强制重新配置,以及如何处理ASM实例启动过程中的常见错误。

Encountered CRS-4124, the OHASD cannot be started, it shows as below:

[bob@ocp ~]$ crsctl start has
CRS-4124: 未能启动 Oracle High Availability Services。
CRS-4000: 命令 Start 失败, 或已完成但出现错误。

Cannot startup the instance:

[bob@ocp ~]$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.1.0 Production on 星期三 8月 28 13:56:52 2019

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> conn / as sysasm
Connected to an idle instance.
SQL> startup
ORA-01078: failure in processing system parameters
ORA-29701: unable to connect to Cluster Synchronization Service

The solution refer to
CRS-4124: Oracle High Availability Services startup failed.
and
Solutions: error while starting of Oracle Single instance ASM Database
Go to directory /u01/app/bob/product/11.2.0/grid/crs/install/, use below two commands,

./roothas.pl -deconfig -force
./roothas.pl

It will have below problem when execute ./roothas.pl.

[root@ocp install]# ./roothas.pl
defined(@array) is deprecated at crsconfig_lib.pm line 1702.
	(Maybe you should just omit the defined()?)
defined(@array) is deprecated at crsconfig_lib.pm line 1702.
	(Maybe you should just omit the defined()?)
defined(@array) is deprecated at crsconfig_lib.pm line 1780.
	(Maybe you should just omit the defined()?)
2019-08-28 14:02:58: Checking for super user privileges
2019-08-28 14:02:58: User has super user privileges
2019-08-28 14:02:58: Parsing the host name
Using configuration parameter file: ./crsconfig_params
LOCAL ADD MODE
Creating OCR keys for user 'bob', privgrp 'tom'..
Operation successful.
CRS-4664: Node ocp successfully pinned.
Adding daemon to inittab
CRS-4124: Oracle High Availability Services startup failed.
CRS-4000: Command Start failed, or completed with errors.
ohasd failed to start: Inappropriate ioctl for device
ohasd failed to start: Inappropriate ioctl for device at ./roothas.pl line 296.

Use below method to solve this issue,

[root@ocp install]# ./roothas.pl -deconfig -force
defined(@array) is deprecated at crsconfig_lib.pm line 1702.
	(Maybe you should just omit the defined()?)
defined(@array) is deprecated at crsconfig_lib.pm line 1702.
	(Maybe you should just omit the defined()?)
defined(@array) is deprecated at crsconfig_lib.pm line 1780.
	(Maybe you should just omit the defined()?)
2019-08-28 14:23:15: Checking for super user privileges
2019-08-28 14:23:15: User has super user privileges
2019-08-28 14:23:15: Parsing the host name
Using configuration parameter file: ./crsconfig_params
CRS-2613: Could not find resource 'ora.cssd'.
CRS-4000: Command Stop failed, or completed with errors.
CRS-2613: Could not find resource 'ora.cssd'.
CRS-4000: Command Delete failed, or completed with errors.
CRS-4133: Oracle High Availability Services has been stopped.
ADVM/ACFS is not supported on redhat-release-server-7.2-9.el7.x86_64

ACFS-9201: Not Supported
Successfully deconfigured Oracle Restart stack
[root@ocp install]# ./roothas.pl
defined(@array) is deprecated at crsconfig_lib.pm line 1702.
	(Maybe you should just omit the defined()?)
defined(@array) is deprecated at crsconfig_lib.pm line 1702.
	(Maybe you should just omit the defined()?)
defined(@array) is deprecated at crsconfig_lib.pm line 1780.
	(Maybe you should just omit the defined()?)
2019-08-28 14:23:39: Checking for super user privileges
2019-08-28 14:23:39: User has super user privileges
2019-08-28 14:23:39: Parsing the host name
Using configuration parameter file: ./crsconfig_params
LOCAL ADD MODE
Creating OCR keys for user 'bob', privgrp 'tom'..
Operation successful.
CRS-4664: Node ocp successfully pinned.
Adding daemon to inittab
CRS-4123: Oracle High Availability Services has been started.
ohasd is starting
ADVM/ACFS is not supported on redhat-release-server-7.2-9.el7.x86_64




ocp     2019/08/28 14:23:53     /u01/app/bob/product/11.2.0/grid/cdata/ocp/backup_20190828_142353.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server
[root@ocp install]# exit
logout

When doing the command ./roothas.pl, type below command in another terminal, the ./roothas.pl will be executed successful.

[root@ocp ~]# /bin/dd if=/var/tmp/.oracle/npohasd of=/dev/null bs=1024 count=1

Start the OHASD,

[bob@ocp install]$ crsctl start has
CRS-4640: Oracle High Availability Services 已处于活动状态
CRS-4000: 命令 Start 失败, 或已完成但出现错误。
[bob@ocp install]$ crsctl check has
CRS-4638: Oracle High Availability Services 联机
[bob@ocp install]$ crs_stat -t
名称         类型         目标    状态    主机
------------------------------------------------------------
ora.cssd       ora.cssd.type  OFFLINE   OFFLINE
ora.diskmon    ora....on.type OFFLINE   OFFLINE
[bob@ocp install]$ crs_start ora.cssd
Attempting to start `ora.cssd` on member `ocp`
Attempting to start `ora.diskmon` on member `ocp`
Start of `ora.diskmon` on member `ocp` succeeded.
Start of `ora.cssd` on member `ocp` succeeded.

The successful result was:

[bob@ocp install]$ crsctl check has
CRS-4638: Oracle High Availability Services is online
[bob@ocp install]$

Start the ASM instance:

[bob@ocp install]$ sqlplus "/as sysasm"

SQL*Plus: Release 11.2.0.1.0 Production on 星期三 8月 28 14:40:44 2019

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORA-00099: warning: no parameter file specified for ASM instance
ASM instance started

Total System Global Area  283930624 bytes
Fixed Size		    2212656 bytes
Variable Size		  256552144 bytes
ASM Cache		   25165824 bytes
ORA-15110: no diskgroups mounted


SQL>  select name,state,type from v$asm_diskgroup;

NAME
--------------------------------------------------------------------------------
STATE				  TYPE
--------------------------------- ------------------
DATA
DISMOUNTED


SQL> alter diskgroup data mount;

Diskgroup altered.

SQL> select name,state,type from v$asm_diskgroup;

NAME
--------------------------------------------------------------------------------
STATE				  TYPE
--------------------------------- ------------------
DATA
MOUNTED 			  NORMAL

SQL> select instance_name, status from v$instance;

INSTANCE_NAME
------------------------------------------------
STATUS
------------------------------------
+ASM
STARTED


SQL>

SQL> quit

CRS-4124: Oracle High Availability Services startup failed.
Solutions: error while starting of Oracle Single instance ASM Database
oracle 11g R2 单实例 ASM 启动:ORA-29701:+unable+to+connect+to+Cluster+Synchronization+Service
ORA-15110: no diskgroups mounted

这个错误表明 Oracle 数据库在启动时无法读取初始化参数文件(spfile),并且还无法连接到 **Cluster Synchronization Service (CSS)**,这通常出现在使用 Oracle RAC 或启用了 ASM 的单实例环境中。我们来逐步分析并解决这个问题。 --- ### 🔍 错误解析: ```sql ORA-01078: failure in processing system parameters ORA-01565: error in identifying file '+DATA/orcl/spfileorcl.ora' ORA-17503: ksfdopn:2 Failed to open file +DATA/orcl/spfileorcl.ora ORA-29701: unable to connect to Cluster Synchronization Service ``` #### 含义: - `ORA-29701`: 说明 Oracle 实例无法连接到 **CSS(Cluster Synchronization Service)**,这是 Oracle 集群件(如 Oracle Restart 或 RAC)的基础服务。 - `ORA-01565` / `ORA-17503`: 表示数据库试图从 ASM 磁盘组 `+DATA` 中读取 SPFILE 文件 `spfileorcl.ora` 失败,可能是路径错误、ASM 没有启动或磁盘组未挂载。 - `ORA-01078`: 因为无法加载参数文件导致后续初始化失败。 --- ## ✅ 解决方案 ### ✅ 步骤 1:确认 CSS 服务是否运行 CSS 是 Oracle 自动存储管理(ASM)和集群环境所依赖的关键后台服务。 #### 检查 CSS 状态: ```bash crsctl check css ``` 如果返回 `Cannot communicate with CRS`, 则需要启动 CSS。 #### 启动 CSS 服务: ```bash crsctl start resource ora.cssd ``` 或者如果是 Oracle Restart 环境: ```bash srvctl start nodeapps ``` > 💡 注意:你需要以 `grid` 用户或具有权限的用户运行这些命令。 --- ### ✅ 步骤 2:检查 ASM 实例是否已启动 因为你的 spfile 在 `+DATA`(ASM 磁盘组),所以必须先启动 ASM 实例。 #### 使用 grid 用户登录 SQL*Plus 并检查 ASM 实例状态: ```bash sqlplus / as sysasm ``` 然后执行: ```sql SELECT instance_name, status FROM v$instance; ``` 如果没有运行,启动它: ```sql STARTUP; ``` #### 查看磁盘组是否已挂载: ```sql SELECT name, state, total_mb, free_mb FROM v$asm_diskgroup; ``` 确保 `+DATA` 磁盘组处于 `MOUNTED` 状态。 如果不是,尝试手动挂载: ```sql ALTER DISKGROUP DATA MOUNT; ``` --- ### ✅ 步骤 3:使用 PFILE 启动数据库(临时绕过 SPFILE) 由于无法读取 SPFILE,我们可以创建一个简单的 PFILE 来引导数据库。 #### 方法一:从内存中生成 PFILE(如果有可用信息) 如果你之前成功启动过,可以尝试用默认模板生成一个小的 PFILE。 编辑 `$ORACLE_HOME/dbs/initorcl.ora` 文件: ```bash vi $ORACLE_HOME/dbs/initorcl.ora ``` 写入以下内容(根据实际情况修改): ```ini db_name=orcl instance_name=orcl memory_target=1G db_create_file_dest='+DATA' diagnostic_dest='/u01/app/oracle' remote_login_passwordfile='EXCLUSIVE' undo_tablespace='UNDOTBS1' control_files = (+DATA/orcl/controlfile/current.256.123456789) ``` > ⚠️ 注意:`control_files` 路径需要正确。你可以通过 ASM CMD 工具查找实际路径。 #### 使用 ASM cmd 查找控制文件: ```bash asmcmd ls +DATA/orcl/controlfile/ ``` 你会看到类似 `current.256.123456789` 的文件名,填入即可。 --- ### ✅ 步骤 4:使用 PFILE 启动数据库 回到 sqlplus(以 oracle 用户): ```bash sqlplus / as sysdba ``` 然后: ```sql STARTUP PFILE='$ORACLE_HOME/dbs/initorcl.ora'; ``` 如果成功,数据库将启动。 --- ### ✅ 步骤 5:重建 SPFILE(推荐) 一旦数据库正常运行,建议从 PFILE 创建新的 SPFILE 并保存到 ASM: ```sql CREATE SPFILE='+DATA/orcl/spfileorcl.ora' FROM PFILE='$ORACLE_HOME/dbs/initorcl.ora'; ``` 然后重启数据库: ```sql SHUTDOWN IMMEDIATE; STARTUP; ``` 此时应该可以直接识别 SPFILE。 --- ### ✅ 步骤 6:验证自动启动配置(可选) 若希望数据库随系统自动启动,请配置: ```bash srvctl add database -d orcl -o $ORACLE_HOME srvctl start database -d orcl ``` --- ## 🧰 常见排查工具汇总 | 命令 | 用途 | |------|------| | `crsctl check css` | 检查 CSS 是否运行 | | `crsctl start resource ora.cssd` | 启动 CSS | | `sqlplus / as sysasm` | 登录 ASM 实例 | | `asmcmd` | 浏览 ASM 磁盘组文件 | | `srvctl status database -d orcl` | 查看数据库状态(RAC/Restart) | --- ## ❗ 总结处理流程: 1. 确保 **CSS 服务运行** 2. 启动 **ASM 实例**,挂载 `+DATA` 磁盘组 3. 若 SPFILE 丢失或不可读,使用 **PFILE 引导** 4. 成功后,重建 SPFILE 到 ASM 5. 以后避免直接删除或移动 SPFILE ---
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值