linux查看裸设备
1.fdisk -l 查看所有系统中的裸设备使用情况,包括分区的和没有分区的
2.对裸设备进行分区
eg:fdisk /dev/sdf 依次需要输入:n|p|1|w
3.配置裸设备映射
rh4: 编辑 /etc/sysconfig/rawdevices
eg:/dev/raw/raw5 /dev/sdf1
4.配置oracle用户对裸设备的权限,编辑/etc/udev/permissions.d/50-udev.permissions
#raw devices
raw*:oracle:oinstall:0660
raw/*:oracle:oinstall:0660
5.确认裸设备自动启动
#chkconfig --list rawdevices
rawdevices 0:off 1:off 2:off 3:on 4:on 5:on 6:off
6.启动rawdevices服务,确认裸设备创建成功
#service rawdevices restart
7.检查裸设备权限是否是oracle:oinstall
cd /dev/raw
ll
8.创建ASM磁盘
#/etc/init.d/oracleasm createdisk VOL3 /dev/sdf1
其他节点需要
#/etc/init.d/oracleasm scandisks
ASMLib方式:
alter system set asm_diskstring='ORCL:VOL*' scope=both;
create diskgroup RAC_DISK external redundancy DISK 'ORCL:VOL1','ORCL:VOL3','ORCL:VOL4';
drop diskgroup asmdisk including contents
裸设备方式:
alter system set asm_diskstring='/dev/raw/raw[1-6]' scope=both
alter diskgroup RAC_DISK add disk '/dev/oracleasm/VOL1' name VOL1,'/dev/oracleasm/VOL3' name VOL3,'/dev/oracleasm/VOL4' name VOL4;
col state format a10
col name format a15
col failgroup format a20
set line 200
select STATE,REDUNDANCY,TOTAL_MB,FREE_MB,NAME,FAILGROUP from v$asm_disk;
select GROUP_NUMBER,NAME,STATE,TYPE,TOTAL_MB,FREE_MB,UNBALANCED from v$asm_diskgroup;