此应用程序提供的帮助文字很差,信息不全面。我是查了资料之后才知道使用-i 参数可以重新配置
Oracleasm 。
[root@oracle16 ~]# oracleasm configure -i
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 []: dba
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: done
[root@oracle16 ~]# oracleasm configure
ORACLEASM_ENABLED=true
ORACLEASM_UID=oracle
ORACLEASM_GID=dba
ORACLEASM_SCANBOOT=true
ORACLEASM_SCANORDER=""
ORACLEASM_SCANEXCLUDE=""
[root@oracle16 ~]#
配置完成后,就可以使用oracleasm createdisk 创建磁盘了。
[root@oracle16 ~]# fdisk -l
Disk /dev/sda: 598.8 GB, 598879502336 bytes
255 heads, 63 sectors/track, 72809 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 6387 51199155 82 Linux swap / Solaris
/dev/sda3 6388 11486 40957717+ 83 Linux
/dev/sda4 11487 72800 492504705 83 Linux
[root@oracle16 ~]# oracleasm createdisk vol1 /dev/sda4
Writing disk header: done
Instantiating disk: done
创建成功,以下是检查部分。
[root@oracle16 ~]# oracleasm listdisks
VOL1
[root@oracle16 ~]# oracleasm querydisk
Usage: oracleasm-querydisk [-l <manager>] [-v] [-d|-p] <label>|<device> ...
[root@oracle16 ~]# oracleasm querydisk vol1
Disk "VOL1" is a valid ASM disk
[root@oracle16 ~]# oracleasm querydisk -d vol1
Disk "VOL1" is a valid ASM disk on device /dev/sda4[8,4]
[root@oracle16 ~]# oracleasm querydisk -p vol1
Disk "VOL1" is a valid ASM disk
/dev/sda4: LABEL="VOL1" TYPE="oracleasm"
总而言之,oracleasm 使用帮助还需要多看看,否则一碰到问题都不知道怎么处理。这个问题可能是在oracle 用户还没创建之前,oracle asmlib 包就已经安装上,并且配置了,只是配置时啥也没输入。整体上感觉它还没raw devices 好用。至于性能上是否有多大差别,这里不能下结论。
更多Oracle相关信息见Oracle 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=12
