Using Raw Devices in Oracle ASM

Q:When will you use raw devices in ASM?

A:

   1.There's no approximate asmlib for kernel of your host

   2.You wanna promote I/O performance of database under your estimation compared with FS


How to create raw devices in linux?

Environment:Redhat 5.4|Oracle Grid Infrastucture+Oracle Database 11G r2

That's an example:

1.Add two disks to current system:/dev/sdg    /dev/sdh
2.Create 2 partitions every disk:/dev/sdg1  /dev/sdg2     /dev/sdh1   /dev/sdh2

If you run asmca with grid user,you cannot find any available disk

3.Create raw devices

vim /etc/udev/rules.d/60-raw.rules
ACTION=="add",KERNEL=="/dev/sdg1",RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add",KERNEL=="/dev/sdg2",RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add",KERNEL=="/dev/sdh1",RUN+="/bin/raw /dev/raw/raw3 %N"
ACTION=="add",KERNEL=="/dev/sdh2",RUN+="/bin/raw /dev/raw/raw4 %N"
KERNEL=="raw?",OWNER="grid" GROUP="oinstall",MODE="0660"
start_udev

4.Create ASM diskgroup

su - grid
sqlplus / as sysasm
alter system set disk_strings='/dev/raw/raw1,/dev/raw/raw2,/dev/raw/raw3,/dev/raw/raw4' scope=spfile;
startup force;
CREATE DISKGROUP TESTDG1 NORMAL REDUNDANCY
    FAILGROUP FG1
        DISK '/dev/raw/raw1' NAME F1_D1
        DISK '/dev/raw/raw3' NAME F1_D2
    FAILGROUP FG2
        DISK '/dev/raw/raw2' NAME F2_D1
        DISK '/dev/raw/raw4' NAME F2_D2;


你可能感兴趣的:(ASM,raw,device)