解决asm挂载盘失败ORA-15040 ORA-15020

在这里插入图片描述
查看磁盘发现sde的分区sde1重新启动后,就消失了!

[grid@dell ~]$ lsblk
NAME              MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
......
sde                 8:64   0   1.8T  0 disk 
sdc                 8:32   0   1.8T  0 disk 
`-vg_data-lv_data 252:2    0   5.5T  0 lvm  /u01
......

用fdisk检查,发现分区是有的!

[grid@dell ~]$ sudo fdisk /dev/sde
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p

Disk /dev/sde: 1999.8 GB, 1999844147200 bytes, 3905945600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x47e2b635

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1            2048  3905945599  1952971776   83  Linux

Command (m for help): 

重新划分分区后,分区有了,重新启动后分区有没有了!

使用sysasm用户登录进去,查询磁盘的HEADER_STATU是MEMBER

[grid@dell ~]$ sqlplus / as sysasm

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Sep 27 13:49:37 2020
Version 19.3.0.0.0
SQL>  select GROUP_NUMBER,NAME,HEADER_STATUS,TOTAL_MB,FREE_MB from V$ASM_DISK;
GROUP_NUMBER NAME			    HEADER_STATU   TOTAL_MB    FREE_MB
------------ ------------------------------ ------------ ---------- ----------
	   0				    MEMBER		  0	     0
	   0				    MEMBER		  0	     0

清除磁盘头信息

sudo dd if=/dev/zero of=/dev/sdh1 bs=1048576 count=50
sudo dd if=/dev/zero of=/dev/sdg1 bs=1048576 count=50
sudo dd if=/dev/zero of=/dev/sde1 bs=1048576 count=50

再查询,发现变成 CANDIDATE,也就是可以用于新的磁盘组。

[grid@dell ~]$ sqlplus / as sysasm

SQL> select GROUP_NUMBER,NAME,HEADER_STATUS,TOTAL_MB,FREE_MB from V$ASM_DISK;

GROUP_NUMBER NAME			    HEADER_STATU   TOTAL_MB    FREE_MB
------------ ------------------------------ ------------ ---------- ----------
	   0				    CANDIDATE		  0	     0
	   0				    CANDIDATE		  0	     0

使用asmca创建磁盘,出错!

ORA-15018: diskgroup cannot be created
ORA-15020: discovered duplicate ASM disk "DA3_0001"

发现是Disk Discovery Path出错,实际是没有设置。重新设置后在运行asmca,发现计划选择的磁盘HEADER_STATUS变成FORMER,不是CANDIDATE,在运行dd擦出一下磁盘头。
在这里插入图片描述

在这里插入图片描述
重新启动后,磁盘组又mount不成功!
在alert log里面有这样的提示:

/u01/app/19.0.0/grid/log/diag/asm/+asm/+ASM/trace/alert_+ASM.log
WARNING: detected duplicate paths to the same disk:
  '/dev/asmdisks/asmdisk01' and
  '/dev/sdg1'
ERROR: diskgroup DATA3 was not mounted
ORA-15032: not all alterations performed
ORA-15017: diskgroup "DATA3" cannot be mounted
ORA-15040: diskgroup is incomplete

实际是参数asm_diskstring没有设置造成这两个磁盘重复,没有挂上,diskgroup is incomplete实际是唯一的磁盘没有挂上,手工可以挂上。

[grid@dell ~]$ sqlplus / as sysasm
SQL> show parameter disk
NAME				     TYPE	 VALUE
------------------------------------ ----------- ------------------------------
asm_diskgroups			     string
asm_diskstring			     string
SQL> alter system set asm_diskstring='/dev/asmdisks';
System altered.
SQL> alter diskgroup data3 mount;
Diskgroup altered.

查看ASM的配置是正常的。

[grid@dell ~]$ srvctl config asm/dev/asmdisks
ASM home: <CRS home>
Password file: +DATA/orapwasm
Backup of Password file: 
ASM listener: LISTENER
Spfile: +DATA/ASM/ASMPARAMETERFILE/registry.253.1052047345
ASM diskgroup discovery string: /dev/asmdisks
[grid@dell ~]$ 

创建一个pfile,内容是从alert log里面找到的,解决!

[grid@dell ~]$ cat $ORACLE_HOME/dbs/init+ASM.ora
  large_pool_size          = 12M
  remote_login_passwordfile= "EXCLUSIVE"
  asm_diskstring           = "/dev/asmdisks"
  asm_power_limit          = 1
[grid@dell ~]$ 

重新启动也没有问题!

[grid@dell ~]$ srvctl status diskgroup -diskgroup data3
Disk Group data3 is running on dell
姚远ACE CSDN认证博客专家 ACE 华为云 MVP
Oracle ACE,华为云 MVP,Oracle10g,12c OCM; MySQL 5.6,5.7,8.0 OCP;CCNA; EMC Certified; IBM P Certified; RHCE; SQLServer 764; DB2 Certified; TOEIC 890;获得过两次国家部级科技进步奖;发明过两项计算机专利。微信:yaoyuanace 邮箱:yaoyuanace(at)qq.com
已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: Age of Ai 设计师:meimeiellie 返回首页