使用OS文件替代裸设备创建ASM卷组

当我们使用ASM的时候,往往需要使用裸设备来创建磁盘卷组,不过我们也可以使用OS文件来替代这一做法.

1.设置asm_allow_only_raw_disks为false,允许ASM实例使用其他设备.

SQL> alter system set "_asm_allow_only_raw_disks"=false scope=spfile; 

System altered.

2.使用操作系统dd命令来创建几个空文件.

[grid@oracle11g ~]$ dd if=/dev/zero of=/oracle/app/asm_filesystem_devices/asm_filesystem_dsk1 bs=1M count=500

500+0 records in

500+0 records out

524288000 bytes (524 MB) copied, 0.617829 seconds, 849 MB/s

[grid@oracle11g ~]$ dd if=/dev/zero of=/oracle/app/asm_filesystem_devices/asm_filesystem_dsk2 bs=1M count=500

500+0 records in

500+0 records out

524288000 bytes (524 MB) copied, 0.662035 seconds, 792 MB/s

[grid@oracle11g ~]$ dd if=/dev/zero of=/oracle/app/asm_filesystem_devices/asm_filesystem_dsk3 bs=1M count=500

500+0 records in

500+0 records out

524288000 bytes (524 MB) copied, 4.00641 seconds, 131 MB/s

[grid@oracle11g ~]$ dd if=/dev/zero of=/oracle/app/asm_filesystem_devices/asm_filesystem_dsk4 bs=1M count=500

500+0 records in

500+0 records out

524288000 bytes (524 MB) copied, 0.844075 seconds, 621 MB/s

3.检查是否可用

SQL> alter system set asm_diskstring='/oracle/app/asm_filesystem_devices' scope=both;   

System altered.

SQL> select DISK_NUMBER,MOUNT_STATUS,HEADER_STATUS,MODE_STATUS,STATE,PATH from v$asm_disk order by path;

DISK_NUMBER MOUNT_S HEADER_STATU MODE_ST STATE    PATH

----------- ------- ------------ ------- -------- ----------------------------------------------------------------------

          5 CLOSED  CANDIDATE    ONLINE  NORMAL   /oracle/app/asm_filesystem_devices/asm_filesystem_dsk1

          7 CLOSED  CANDIDATE    ONLINE  NORMAL   /oracle/app/asm_filesystem_devices/asm_filesystem_dsk2

          6 CLOSED  CANDIDATE    ONLINE  NORMAL   /oracle/app/asm_filesystem_devices/asm_filesystem_dsk3

          8 CLOSED  CANDIDATE    ONLINE  NORMAL   /oracle/app/asm_filesystem_devices/asm_filesystem_dsk4

这里我们就可以使用我们的文件系统的文件了,摆脱了对裸设备的依赖.

分享到: 更多

Post a Comment

Your email is never published nor shared. Required fields are marked *