RHEL6使用udev修改asm磁盘名
RHEL6使用udev修改asm磁盘名
现有系统使用emc power多路径软件,会出现重启后磁盘名变化的情况,为了规范asm磁盘的使用,需要使用udev固定磁盘名。具体步骤如下,rac下可以一个节点,一个节点的方式修改
1,关闭oracle数据库
2,ASM下修改asm_diskstring,原来此参数的设置为/dev/emcpower*1
alter system set asm_diskstring='/dev/asmdisks/asm*' scope=spfile sid='*';
3,修改udev映射文件,有几个磁盘就需要添加几行类似文件
KERNEL=="emcpower*1", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="360000970000295900314533030344131", NAME+="asmdisks/asmarch0000", ACTION=="add|change", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="emcpower*1", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="360000970000295900314533030344130", NAME+="asmdisks/asmarch0001", ACTUIB=="add|change", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="emcpower*1", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="360000970000295900314533030343834", NAME+="asmdisks/asmdata0000", ACTUIB=="add|change", OWNER="grid", GROUP="asmadmin", MODE="0660"
.............
4,运行start_udev使磁盘生效
[oracle@sdcmpdb1 asmdisks]$ ls
asmarch0000 asmdata0002 asmdata0013 asmdata0017 asmredo0002 asmredo0006 asmredo0010 asmredo0014 asmredo0018 asmredo0022 asmtemp0002 asmundo0000
asmarch0001 asmdata0003 asmdata0014 asmdata0018 asmredo0003 asmredo0007 asmredo0011 asmredo0015 asmredo0019 asmredo0023 asmtemp0003 asmundo0001
asmdata0000 asmdata0011 asmdata0015 asmredo0000 asmredo0004 asmredo0008 asmredo0012 asmredo0016 asmredo0020 asmtemp0000 asmtemp0004 asmundo0002
asmdata0001 asmdata0012 asmdata0016 asmredo0001 asmredo0005 asmredo0009 asmredo0013 asmredo0017 asmredo0021 asmtemp0001 asmtemp0005 asmundo0003
[oracle@sdcmpdb1 asmdisks]$ pwd
/dev/asmdisks
5,重启asm和数据库即可