部署rac 提示ORA-15018: diskgroup cannot be created解决办法

本文详细记录了在配置 Oracle Grid Infrastructure 集群时遇到的问题,包括 ASM 磁盘配置失败,并提供了解决方法。通过调整权限设置和重新配置 ASM 磁盘,成功解决了集群启动问题。

[root@his2 soft]# /app/grid/product/11.2.0/grid/root.sh
Running Oracle 11g root script...

The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /app/grid/product/11.2.0/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]:
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...


Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /app/grid/product/11.2.0/grid/crs/install/crsconfig_params
Creating trace directory
LOCAL ADD MODE
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
OLR initialization - successful
Adding daemon to inittab
ACFS-9200: Supported
ACFS-9300: ADVM/ACFS distribution files found.
ACFS-9307: Installing requested ADVM/ACFS software.
ACFS-9308: Loading installed ADVM/ACFS drivers.
ACFS-9321: Creating udev for ADVM/ACFS.
ACFS-9323: Creating module dependencies - this may take some time.
ACFS-9327: Verifying ADVM/ACFS devices.
ACFS-9309: ADVM/ACFS installation correctness verified.
CRS-2672: Attempting to start 'ora.mdnsd' on 'his2'
CRS-2676: Start of 'ora.mdnsd' on 'his2' succeeded
CRS-2672: Attempting to start 'ora.gpnpd' on 'his2'
CRS-2676: Start of 'ora.gpnpd' on 'his2' succeeded
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'his2'
CRS-2672: Attempting to start 'ora.gipcd' on 'his2'
CRS-2676: Start of 'ora.cssdmonitor' on 'his2' succeeded
CRS-2676: Start of 'ora.gipcd' on 'his2' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'his2'
CRS-2672: Attempting to start 'ora.diskmon' on 'his2'
CRS-2676: Start of 'ora.diskmon' on 'his2' succeeded
CRS-2676: Start of 'ora.cssd' on 'his2' succeeded

Disk Group ORACRS creation failed with the following message:
ORA-15018: diskgroup cannot be created
ORA-15031: disk specification '/dev/oracleasm/disks/CRSVOL' matches no disks
ORA-15025: could not open disk "/dev/oracleasm/disks/CRSVOL"
ORA-15056: additional error message


Configuration of ASM ... failed
see asmca logs at /app/grid/grid_base/cfgtoollogs/asmca for details
Did not succssfully configure and start ASM at /app/grid/product/11.2.0/grid/crs/install/crsconfig_lib.pm line 6464.
/app/grid/product/11.2.0/grid/perl/bin/perl -I/app/grid/product/11.2.0/grid/perl/lib -I/app/grid/product/11.2.0/grid/crs/install /app/grid/product/11.2.0/grid/crs/install/rootcrs.pl execution failed
[root@his2 soft]#
Last login: Thu Apr 17 16:00:56 2014 from 10.0.0.254
[root@his2 ~]# ll -l /dev/oracleasm/disks/CRSVOL
brw------- 1 root root 8, 1 Apr 17 15:16 /dev/oracleasm/disks/CRSVOL
[root@his2 ~]# cd /dev/oracleasm/disks/
[root@his2 disks]# ls
CRSVOL  DATVOL  FRAVOL
[root@his2 disks]# ll
total 0
brw------- 1 root root 8,  1 Apr 17 15:16 CRSVOL       这边权限出了问题导致
brw------- 1 root root 8, 17 Apr 17 15:16 DATVOL
brw------- 1 root root 8, 33 Apr 17 15:16 FRAVOL
[root@his2 disks]# cd ./usr/sbin/oracleasm configure
-bash: cd: ./usr/sbin/oracleasm: No such file or directory
[root@his2 disks]# /usr/sbin/oracleasm configure
ORACLEASM_ENABLED=true
ORACLEASM_UID=grid
ORACLEASM_GID=onstall
ORACLEASM_SCANBOOT=true
ORACLEASM_SCANORDER=""
ORACLEASM_SCANEXCLUDE=""
[root@his2 disks]# /etc/init.d/oracleasm configure
Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library
driver.  The following questions will determine whether the driver is
loaded on boot and what permissions it will have.  The current values
will be shown in brackets ('[]').  Hitting without typing an
answer will keep that current value.  Ctrl-C will abort.

Default user to own the driver interface [grid]: grid
Default group to own the driver interface [onstall]: oinstall
Start Oracle ASM library driver on boot (y/n) [y]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver:                     [  OK  ]
Scanning the system for Oracle ASMLib disks:               [  OK  ]
[root@his2 disks]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
[root@his2 disks]# oracleasm listdisks;
CRSVOL
DATVOL
FRAVOL
[root@his2 disks]# cd /dev/oracleasm/disks/
[root@his2 disks]# ll
total 0
brw-rw---- 1 grid oinstall 8,  1 Apr 17 15:16 CRSVOL
brw-rw---- 1 grid oinstall 8, 17 Apr 17 15:16 DATVOL
brw-rw---- 1 grid oinstall 8, 33 Apr 17 15:16 FRAVOL
[root@his2 disks]# /app/grid/product/11.2.0/grid/root.sh
Running Oracle 11g root script...

The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /app/grid/product/11.2.0/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /app/grid/product/11.2.0/grid/crs/install/crsconfig_params
CRS-4402: The CSS daemon was started in exclusive mode but found an active CSS daemon on node his1, number 1, and is terminating
An active cluster was found during exclusive startup, restarting to join the cluster
Configure Oracle Grid Infrastructure for a Cluster ... succeeded
[root@his2 disks]# crsctl stat res -t
-bash: crsctl: command not found
[root@his2 disks]# su - grid
[grid@his2 ~]$ 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
[grid@his2 ~]$ crsstat -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS      
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ORACRS.dg
               ONLINE  ONLINE       his1                                        
               ONLINE  ONLINE       his2                                        
ora.asm
               ONLINE  ONLINE       his1                     Started            
               ONLINE  ONLINE       his2                                        
ora.gsd
               OFFLINE OFFLINE      his1                                        
               OFFLINE OFFLINE      his2                                        
ora.net1.network
               ONLINE  ONLINE       his1                                        
               ONLINE  ONLINE       his2                                        
ora.ons
               ONLINE  ONLINE       his1                                        
               ONLINE  ONLINE       his2                                        
ora.registry.acfs
               ONLINE  ONLINE       his1                                        
               ONLINE  ONLINE       his2                                        
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       his1                                        
ora.cvu
      1        ONLINE  ONLINE       his1                                        
ora.his1.vip
      1        ONLINE  ONLINE       his1                                        
ora.his2.vip
      1        ONLINE  ONLINE       his2                                        
ora.oc4j
      1        ONLINE  ONLINE       his1                                        
ora.scan1.vip
      1        ONLINE  ONLINE       his1                                        
[grid@his2 ~]$ crsctk check crs
-bash: crsctk: command not found
[grid@his2 ~]$ 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
[grid@his2 ~]$ ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       2368
         Available space (kbytes) :     259752
         ID                       : 1459065767
         Device/File Name         :    +ORACRS
                                    Device/File integrity check succeeded

                                    Device/File not configured

                                    Device/File not configured

                                    Device/File not configured

                                    Device/File not configured

         Cluster registry integrity check succeeded

         Logical corruption check bypassed due to non-privileged user

[grid@his2 ~]$ crsctl query css votedisk
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   11b2373f9bc94f17bfd8c7e39a386573 (/dev/oracleasm/disks/CRSVOL) [ORACRS]
Located 1 voting disk(s).

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29065182/viewspace-1144273/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/29065182/viewspace-1144273/

这个错误信息是 Oracle 数据库在启动(`startup`)时出现的典型问题,主要涉及 **初始化参数文件(spfile)无法找到或访问**,尤其是当数据库使用的是 **ASM(Automatic Storage Management)磁盘组** 存储时。 --- ### ❌ 错误分析 ```bash 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-15056: additional error message ORA-17503: ksfdopn:2 Failed to open file +DATA/orcl/spfileorcl.ora ORA-15001: diskgroup "DATA" does not exist or is not mounted ``` #### 逐条解释: - `ORA-01078`: 启动数据库时无法处理系统参数 —— 通常是找不到或读取不了 spfile/pfile。 - `ORA-01565`: 识别指定的参数文件失败。 - `ORA-17503`: 低层 I/O 操作失败,无法打开文件。 - `ORA-15001`: 表示 ASM 磁盘组 `"DATA"` 不存在或者没有被挂载。 👉 核心问题是:**ASM 实例未运行,或者磁盘组 `DATA` 没有被挂载,导致 Oracle 实例无法读取存放在 `+DATA` 中的 spfile。** --- ## ✅ 解决方案 ### 步骤 1:确认当前环境变量和实例状态 确保你连接到了正确的 Oracle 环境。 ```bash export ORACLE_SID=+ASM # 如果使用 ASM,默认 SID 是 +ASM 或 +ASM1(RAC) sqlplus / as sysdba ``` ### 步骤 2:检查 ASM 实例是否启动 ```sql SQL> SELECT instance_name, status FROM v$instance; -- 应该输出类似: -- INSTANCE_NAME STATUS -- ---------------- ------------ -- +ASM STARTED ``` 如果没有启动,请先启动 ASM 实例: ```sql SQL> startup; ``` > ⚠️ 注意:如果 ASM 也无法启动,可能是磁盘权限、udev 规则、asmlib 配置或磁盘路径问题。 --- ### 步骤 3:查看磁盘组状态 ```sql SQL> SELECT name, state, total_mb, free_mb FROM v$asm_diskgroup; -- 输出示例: -- NAME STATE TOTAL_MB FREE_MB -- ------ --------- -------- ------- -- DATA MOUNTED 10240 3000 ``` 如果你看到 `DATA` 的状态不是 `MOUNTED`,说明它没挂载。 --- ### 步骤 4:尝试手动挂载磁盘组 ```sql ALTER DISKGROUP DATA MOUNT; ``` 如果报错,比如: - `ORA-15032: not all alterations performed` - `ORA-15063: ASM discovered an insufficient number of disks` → 表明 ASM 无法识别构成 `DATA` 磁盘组的物理磁盘。 --- ### 🔍 排查磁盘问题 #### 查看 ASM 发现的磁盘: ```sql SELECT path, header_status, mode_status FROM v$asm_disk; ``` 期望结果:`DATA` 对应的磁盘 `HEADER_STATUS = MEMBER`, `MODE_STATUS = ONLINE` 如果 `header_status` 是 `CANDIDATE` 或 `UNKNOWN`,说明这些磁盘未被正确识别。 --- ### 可能原因及修复方法 | 原因 | 解决方式 | |------|---------| | ASM 实例未启动 | 执行 `sqlplus / as sysdba` → `startup` | | 磁盘权限问题(Linux) | 检查 `/dev/sdX` 权限是否属于 `grid:asmadmin` | | udev 规则未设置 | 配置持久化设备名规则(如 `/etc/udev/rules.d/99-oracle-asmdevices.rules`) | | ASMLib 配置丢失(若使用) | 使用 `oracleasm scandisks` 和 `oracleasm listdisks` | | 磁盘路径变更(如 VM 迁移后) | 重新绑定设备或修改 udev 规则 | --- ### ✅ 成功挂载后启动数据库实例 一旦 `DATA` 磁盘组成功挂载,切换回数据库实例: ```bash export ORACLE_SID=orcl sqlplus / as sysdba ``` 然后启动数据库: ```sql SQL> startup; ``` 此时应该可以正常读取 `+DATA/orcl/spfileorcl.ora` 并启动。 --- ### 💡 替代方案:使用 PFILE 启动(临时) 如果暂时无法恢复 SPFILE,可以从 ASM 中创建一个文本型 PFILE: ```sql -- 在 ASM 实例中导出参数 CREATE PFILE='/tmp/initorcl.ora' FROM SPFILE='+DATA/orcl/spfileorcl.ora'; ``` 然后用该 PFILE 启动数据库: ```sql SQL> CREATE SPFILE FROM PFILE='/tmp/initorcl.ora'; SQL> startup; -- 自动使用 SPFILE ``` > 注意:前提是 ASM 能读到原始 spfile。否则只能手动写一个最小 pfile。 --- ### 🛠 示例:最小 PFILE 启动(应急) ```text # /tmp/initorcl.ora orcl.__db_cache_size=100M orcl.__shared_pool_size=80M *.db_name='orcl' *.control_files='+DATA/orcl/controlfile/current.256.123456789' *.instance_type='RDBMS' *.job_queue_processes=10 *.open_cursors=300 *.pga_aggregate_target=100M *.sga_target=300M *.undo_management='AUTO' *.undo_tablespace='UNDOTBS1' ``` 然后: ```sql SQL> create spfile from pfile='/tmp/initorcl.ora'; SQL> startup; ``` --- ## ✅ 总结流程图 ```text 启动数据库失败 ↓ 检查是否能访问 +DATA/orcl/spfileorcl.ora ↓ 否 → 检查 ASM 实例是否运行? ↓ 否 → 启动 ASM 实例 ↓ 是 → 检查磁盘组 DATA 是否存在并已挂载? ↓ 否 → 挂载磁盘组(需解决磁盘识别问题) ↓ 是 → 尝试重新启动 DB 实例 ↓ 成功 or 失败 → 查看 alert.log 进一步诊断 ``` --- ### ✅ 关键命令汇总 ```bash # 设置环境 export ORACLE_SID=+ASM sqlplus / as sysdba # 检查 ASM 实例 SELECT instance_name, status FROM v$instance; # 启动 ASM startup; # 查看磁盘组 SELECT name, state FROM v$asm_diskgroup; # 挂载磁盘组 ALTER DISKGROUP DATA MOUNT; # 查看磁盘状态 SELECT path, header_status, mode_status FROM v$asm_disk; # 切换到数据库实例 export ORACLE_SID=orcl sqlplus / as sysdba startup; ``` --- ### ✅ 查看告警日志定位细节 ```bash cd $ORACLE_BASE/diag/rdbms/orcl/orcl/trace/ tail -f alert_orcl.log ``` ---
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值