[root@ca-test1 /]# /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 []:oracle
Default group to own the driver interface []:dba
Start Oracle ASM library driver on boot (y/n) [n]:y
Fix permissions of Oracle ASM disks on boot (y/n) [y]:y
Writing Oracle ASM library driver configuration [ OK ]
Creating /dev/oracleasm mount point [ OK ]
Loading module “oracleasm” [ OK ]
Mounting ASMlib driver filesystem [ OK ]
Scanning system for ASM disks [ OK ]
使磁盘对 ASMLib 可用
[root@ca-test1 /]# /etc/init.d/oracleasm disable
Writing Oracle ASM library driver configuration [ OK ]
Unmounting ASMlib driver filesystem [ OK ]
Unloading module “oracleasm” [ OK ]
[root@ca-test1 /]# /etc/init.d/oracleasm enable
Writing Oracle ASM library driver configuration [ OK ]
Loading module “oracleasm” [ OK ]
Mounting ASMlib driver filesystem [ OK ]
Scanning system for ASM disks [ OK ]
创建ASMlib盘
[root@ca-test1 /]# /etc/init.d/oracleasm createdisk VOL1 /dev/sdg
Creating Oracle ASM disk “VOL1” [ OK ]
磁盘名称是 ASCII 大写字母、数字和下划线。它们必须以字母开始。
不再被 ASM 使用的磁盘也可以取消标记:
[root@ca-test1 /]# /etc/init.d/oracleasm deletedisk VOL1
Deleting Oracle ASM disk “VOL1” [ OK ]
可以查询任意的操作系统磁盘,以了解它是否被 ASM 使用:
[root@ca-test1 /]# /etc/init.d/oracleasm querydisk /dev/sdg
Checking if device “/dev/sdg” is an Oracle ASM disk [ OK ]
[root@ca-test1 /]# /etc/init.d/oracleasm querydisk /dev/sdh
Checking if device “/dev/sdh” is an Oracle ASM disk [FAILED]
可以列出和查询现有的磁盘:
[root@ca-test1 /]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3
[root@ca-test1 /]# /etc/init.d/oracleasm querydisk VOL1
Checking for ASM disk “VOL1” [ OK ]
当向 RAC 设置中添加磁盘时,需要通知其他节点该磁盘的存在。在一个节点上运行 ‘createdisk’ 命令,然后在其他每一个节点上运行 ‘scandisks’:
[root@ca-test1 /]# /etc/init.d/oracleasm scandisks
Scanning system for ASM disks