欢迎来到之路教程(on itroad-com)

解决方案1

1.首先检查oracleasm模块是否已加载,以及/dev/oracleasm是否已挂载到系统上。
使用以下命令:

# oracleasm status
Checking if ASM is loaded: no
Checking if /dev/oracleasm is mounted: no
  1. 为了加载模块并挂载 /dev/oracleasm,请使用以下命令:
# oracleasm init
  1. 验证模块状态:
# oracleasm status
Checking if ASM is loaded: yes
Checking if /dev/oracleasm is mounted: yes
  1. 再次尝试重新扫描磁盘。
# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
Instantiating disk "ASM_DISK_01"
Instantiating disk "ASM_DISK_02"
Instantiating disk "ASM_DISK_03"
#

问题

运行“oracleasm scandisks”命令时出错:无法实例化磁盘“ASM_DISK”

新磁盘已分配给主机,用户需要运行磁盘扫描程序。
但是该命令无法实例化新磁盘并出现以下错误。

# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
Instantiating disk "ASM_DISK_01"
Unable to instantiate disk "ASM_DISK_01"
Instantiating disk "ASM_DISK_02"
Unable to instantiate disk "ASM_DISK_02"
Instantiating disk "ASM_DISK_03"
Unable to instantiate disk "ASM_DISK_03"
...

设置细节如下:

# uname -a
Linux NGPRD1S08BKPMED35 3.10.0-693.11.6.el7.x86_64 #1 SMP Thu Dec 28 14:23:39 EST 2017 x86_64 x86_64 x86_64 GNU/Linux
# rpm -qa | grep -i oracleasm
oracleasmlib-2.0.12-1.el7.x86_64
oracleasm-support-2.1.8-1.el6.x86_64
kmod-oracleasm-2.0.8-19.el7.x86_64

oracleasm 日志文件显示以下错误:

# tail /var/log/oracleasm log
==> /var/log/oracleasm <==
Disk "ASM_DISK_01" does not exist or is not instantiated
Instantiating disk "ASM_DISK_01"
oracleasm-instantiate-disk: Unable to open manager: No such device or address
Unable to instantiate disk "ASM_DISK_01"
Disk "ASM_DISK_01" does not exist or is not instantiated
Instantiating disk "ASM_DISK_02"
oracleasm-instantiate-disk: Unable to open manager: No such device or address
Unable to instantiate disk "ASM_DISK_02"
...

'oracleasm scandisks' 运行成功并且没有返回错误。

# /etc/init.d/oracleasm scandisks
Scanning the system for Oracle ASMLib disks:              [  OK  ]

解决方案2

也可能存在模块未加载并且“/etc/init.d/oracleasm configure”也未运行 ar 被中断的情况。
在这种情况下,我们需要先配置 oracleasm,然后重新扫描磁盘。

要配置 oracleasm:

# /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 <ENTER> without typing an
answer will keep that current value.  Ctrl-C will abort.
Default user to own the driver interface [oracle]:
Default group to own the driver interface [oinstall]:
Start Oracle ASM library driver on boot (y/n) [y]:
Scan for Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver:                     [  OK  ]
Scanning the system for Oracle ASMLib disks:               [  OK  ]

再次检查扫描磁盘:

# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
Instantiating disk "ASM_DISK_01"
Instantiating disk "ASM_DISK_02"
Instantiating disk "ASM_DISK_03"
#

解决方案

/sbin/oracleasm V/s /etc/init.d/oracleasm

/sbin/oracleasm 是 ASMLib 的新命令。
新的 /sbin/oracleasm 命令改进了界面和新的子命令。
所以总是使用新的 oracleasm 命令而不是旧的 /etc/init.d/oracleasm scandisks。

上述问题可能有 2 个问题,因此有 2 个解决方案。
按以下概述的顺序尝试它们。

无法实例化磁盘“ASM_DISK”
日期:2020-09-17 00:11:51 来源:oir作者:oir