Open main menu

RAC Attack - Oracle Cluster Database at Home/RAC Attack 12c/Configure Storage Persistent Naming

< RAC Attack - Oracle Cluster Database at Home‎ | RAC Attack 12c


  1. Once the new disks are visible by the server, add a primary partition on each of them with fdisk.
  2. [root@collabn1 ~]# fdisk /dev/sdb Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel with disk identifier 0x97cc9f57. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable. Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) WARNING: DOS-compatible mode is deprecated. It's strongly recommended to switch off the mode (command 'c') and change display units to sectors (command 'u'). Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-652, default 1): <enter> Using default value 1 Last cylinder, +cylinders or +size{K,M,G} (1-652, default 652): <enter> Using default value 652 Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks.
  3. Repeat the same step for sdc, sdd and sde.
  4. When finished, all disks have at least a partition: [root@collabn1 ~]# ls -l /dev/sd?1 brw-rw----. 1 root disk 8, 1 Jul 28 10:16 /dev/sda1 brw-rw----. 1 root disk 8, 17 Jul 28 10:23 /dev/sdb1 brw-rw----. 1 root disk 8, 33 Jul 28 10:27 /dev/sdc1 brw-rw----. 1 root disk 8, 49 Jul 28 10:27 /dev/sdd1 brw-rw----. 1 root disk 8, 65 Jul 28 10:27 /dev/sde1
  5. Configure the option -g for the scsi_id command to expect an UUID from the shared devices.
  6. [root@collabn1 ~]# echo "options=-g" > /etc/scsi_id.config
  7. Test to see if scsi_id - returns data

  8. [root@collabn1 ~]#  /sbin/scsi_id -g -u -d /dev/sdb
    


  9. Prepare the file /etc/udev/rules.d/99-oracle-asmdevices.rules by running the following script:
  10. #!/bin/bash
    #file ~/createOracleAsmUdevRules.sh
    
    i=1
     # ol6 / rhel6 / centos 6 
    cmd="/sbin/scsi_id -g -u -d"
    for disk in sdb sdc sdd sde ; do 
             cat <<EOF >> /etc/udev/rules.d/99-oracle-asmdevices.rules
    KERNEL=="sd?1", BUS=="scsi", PROGRAM=="$cmd /dev/\$parent", \
     RESULT=="`$cmd /dev/$disk`", NAME="asm-disk$i", OWNER="oracle", GROUP="dba", MODE="0660"
    EOF
             i=$(($i+1)) 
    done
    
  11. Once completed, the file should look like the following (except for the scsi UUID).
  12. Note: The lines beginning with "KERNEL" should not be splitted. [root@collabn1 ~]# cat /etc/udev/rules.d/99-oracle-asmdevices.rules KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB2216c54a-825b4598", NAME="asm-disk1", OWNER="oracle", GROUP="dba", MODE="0660" KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB83dd4d7f-d052e72c", NAME="asm-disk2", OWNER="oracle", GROUP="dba", MODE="0660" KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB636da22f-87dc2f88", NAME="asm-disk3", OWNER="oracle", GROUP="dba", MODE="0660" KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB86aaf297-60dcda74", NAME="asm-disk4", OWNER="oracle", GROUP="dba", MODE="0660"
  13. Reload the udev rules and restart udev:
  14. [root@collabn1 ~]# /sbin/partprobe /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1 [root@collabn1 ~]# /sbin/udevadm test /block/sdb/sdb1 [root@collabn1 ~]# /sbin/udevadm test /block/sdc/sdc1 [root@collabn1 ~]# /sbin/udevadm test /block/sdd/sdd1 [root@collabn1 ~]# /sbin/udevadm test /block/sde/sde1 [root@collabn1 ~]# /sbin/udevadm control --reload-rules [root@collabn1 ~]# /sbin/start_udev Starting udev: [OK] [root@collabn1 ~]# /etc/init.d/oracleasm scandisks [root@collabn1 ~]# /etc/init.d/oracleasm listdisks
  15. The new disks are ready for use:
  16. [root@collabn1 ~]# ls -l /dev/asm* brw-rw----. 1 oracle dba 8, 17 Jul 30 16:17 /dev/asm-disk1 brw-rw----. 1 oracle dba 8, 33 Jul 30 16:17 /dev/asm-disk2 brw-rw----. 1 oracle dba 8, 49 Jul 30 16:17 /dev/asm-disk3 brw-rw----. 1 oracle dba 8, 65 Jul 30 16:17 /dev/asm-disk4