Ivo落班

记录着自己非专业的起步

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
1.使用asmlib(REHL 6以上不支持,由于Redhat公司从RHEL 6这个版本开始决定从Kernel中移除ASMLIB,并且不再给与Oracle公司对于该部分内核代码的访问修改权利,这直接导致Oracle不可能build出FOR RHEL 6的ASMLIB版本了)
2.使用raw设备(rhel 5之前使用/etc/sysconfig/rawdevices,rhel 5之后用udev)
3.直接使用磁盘

asmlib 
创建asm磁盘
  /etc/init.d/oracleasm configure (这里需要输入oracle用户和dba组,所以需要先创建好。)
  /etc/init.d/oracleasm enable
  /etc/init.d/oracleasm createdisk VOL1 /dev/sdb1
  /etc/init.d/oracleasm createdisk VOL2 /dev/sdc1
  /etc/init.d/oracleasm createdisk VOL3 /dev/sdd1
  /etc/init.d/oracleasm createdisk VOL4 /dev/sde1
  /etc/init.d/oracleasm createdisk VOL5 /dev/sdf1
  /etc/init.d/oracleasm createdisk VOL6 /dev/sdg1
获取磁盘变化:/etc/init.d/oracleasm scandisks
查看asm磁盘:/etc/init.d/oracleasm listdisks


2.raw设备

两种方式
2.1 rawdevices (rhel 5之前)
Edit the "/etc/sysconfig/rawdevices" file, adding the following lines.
/dev/raw/raw1 /dev/sdb1
/dev/raw/raw2 /dev/sdc1
/dev/raw/raw3 /dev/sdd1

Restart the rawdevices service using the following command.
service rawdevices restart

Run the following commands and add them the "/etc/rc.local" file.
chown oracle:oinstall /dev/raw/raw1
chown oracle:oinstall /dev/raw/raw2
chown oracle:oinstall /dev/raw/raw3
chmod 600 /dev/raw/raw1
chmod 600 /dev/raw/raw2
chmod 600 /dev/raw/raw3

The ASM raw device disks are now configured.

2.2 udev
(redhat 5及以上版本使用)
Edit the "/etc/udev/rules.d/60-raw.rules" file, adding the following lines.
ACTION=="add",KERNEL=="sde1",RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add",KERNEL=="sdg1",RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add",KERNEL=="sdh1",RUN+="/bin/raw /dev/raw/raw3 %N"
ACTION=="add",KERNEL=="sdi1",RUN+="/bin/raw /dev/raw/raw4 %N"
KERNEL=="raw[1-4]", OWNER="grid", GROUP="asmadmin", MODE="660"
 
Start the udev
#start_udev


3.直接来(oracle 11g 开始能用)
[root@rac1 ~]# ls -l /dev/sdb
brw-r----- 1 root disk 8, 16 Jun 22 09:56 /dev/sdb

[root@rac1 ~]# chown grid:asmadmin /dev/sdb
[root@rac1 ~]# chmod 660 /dev/sdb

[root@rac1 ~]# ls -l /dev/sdb
brw-rw---- 1 grid asmadmin 8, 16 Jun 22 09:56 /dev/sdb

这样子就能在添加asm磁盘的时候认到,不过会报PRVF-5184,忽视直接执行

 

有两点需要注意,一般来说能作为asm磁盘的都是c设备,也就是字符设备,而使用/dev/sdb时没有这个限制。

另外oracle 11g后所有磁盘的权限是 grid:asmadmin 660,10g时是oracle:oinstall 600

posted on 2014-06-22 20:36  Ivo落班  阅读(1073)  评论(0编辑  收藏  举报