test

我去

[oracle@db193 ~]$ mkdir -p /u01/app/oracle/product/19.3.0/db_1
[oracle@db193 ~]$ cd $ORACLE_HOME
[oracle@db193 db_1]$ pwd
/u01/app/oracle/product/19.3.0/db_1
[oracle@db193 db_1]$ ls
[oracle@db193 db_1]$ unzip /u01/media/LINUX.X64_193000_db_home.zip 

磁盘

--OEL7使用udev需要给磁盘创建分区,这里我使用fdisk 将对应盘创建一个主分区,分区号为2(这里只是为了区分):
sdb  sdc  sdd  sde  sdf  sdg 
sdb2 sdc2 sdd2 sde2 sdf2 sdg2
1G   1G   1G   12G  12G  12G

--OEL7中udev需绑定对应磁盘的分区
for i in b c d e f g;
do
echo "KERNEL==\"sd?2\", SUBSYSTEM==\"block\", PROGRAM==\"/usr/lib/udev/scsi_id -g -u -d /dev/\$parent\", RESULT==\"`/usr/lib/udev/scsi_id -g -u -d /dev/sd\$i`\", SYMLINK+=\"asm-disk$i\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\""      
done

--vi /etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL=="sd?2", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB208b8d32-df9af9d6", SYMLINK+="asm-ocr1", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?2", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VBe51f4d0a-1b73c589", SYMLINK+="asm-ocr2", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?2", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VBc63b1aa3-1e290288", SYMLINK+="asm-ocr3", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?2", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB53ee20b6-40c4b9a3", SYMLINK+="asm-data01", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?2", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB3822afbf-62d8a84d", SYMLINK+="asm-data02", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?2", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VBfbb7943a-5ec216e5", SYMLINK+="asm-data03", OWNER="grid", GROUP="asmadmin", MODE="0660"

--udevadm配置重载生效:
[root@db193 rules.d]# udevadm control --reload
[root@db193 rules.d]# udevadm trigger
--确认udev已绑定成功:
[root@db193 rules.d]# ls -l /dev/asm*
lrwxrwxrwx. 1 root root 4 Jul 30 23:45 /dev/asm-data01 -> sde2
lrwxrwxrwx. 1 root root 4 Jul 30 23:45 /dev/asm-data02 -> sdf2
lrwxrwxrwx. 1 root root 4 Jul 30 23:45 /dev/asm-data03 -> sdg2
lrwxrwxrwx. 1 root root 4 Jul 30 23:45 /dev/asm-ocr1 -> sdb2
lrwxrwxrwx. 1 root root 4 Jul 30 23:45 /dev/asm-ocr2 -> sdc2
lrwxrwxrwx. 1 root root 4 Jul 30 23:45 /dev/asm-ocr3 -> sdd2

--第二个节点db195最开始直接使用udevadm操作发现不行,此时需先partprobe,再udevadm触发即可成功
--使用partprobe将磁盘分区表变化信息通知内核,请求操作系统重新加载分区表
[root@db195 ~]# partprobe /dev/sdb
[root@db195 ~]# partprobe /dev/sdc
[root@db195 ~]# partprobe /dev/sdd
[root@db195 ~]# partprobe /dev/sde
[root@db195 ~]# partprobe /dev/sdf
[root@db195 ~]# partprobe /dev/sdg
--udevadm配置重载生效:
[root@db195 ~]# udevadm control --reload
[root@db195 ~]# udevadm trigger
--确认udev已绑定成功:
[root@db195 ~]# ls -l /dev/asm*
lrwxrwxrwx. 1 root root 4 Jul 30 23:49 /dev/asm-data01 -> sde2
lrwxrwxrwx. 1 root root 4 Jul 30 23:49 /dev/asm-data02 -> sdf2
lrwxrwxrwx. 1 root root 4 Jul 30 23:49 /dev/asm-data03 -> sdg2
lrwxrwxrwx. 1 root root 4 Jul 30 23:49 /dev/asm-ocr1 -> sdb2
lrwxrwxrwx. 1 root root 4 Jul 30 23:49 /dev/asm-ocr2 -> sdc2
lrwxrwxrwx. 1 root root 4 Jul 30 23:49 /dev/asm-ocr3 -> sdd2
posted @ 2020-12-16 20:52  LWJ303  阅读(76)  评论(0编辑  收藏  举报
levels of contents