Pages

Wednesday, October 31, 2012

Scary Stuff!


Best costume ever!
http://penny-arcade.com/comic/2012/10/31

Add a raw device to OracleASM on RedHat based Linux VMWare guest


  1. Add disk to server in vm ware console
  2. Sign onto the guest and rescan the host for the new disk
    • echo "- - -" > /sys/class/scsi_host/host0/scan
  3. Run "fdisk -l" to verify the new disk name
  4. Partition the new disk
    • fdisk /dev/sdX (where X is the letter of the new disk). 
    • Create a single primary partition that takes up the entire disk
  5. Find the next raw device number.
    •  ls -l /dev/raw
  6. Mark new disk as raw
    • raw /dev/raw/rawY /dev/sdX1 (where rawY is the next number available in /dev/raw.)
  7. Stamp with ASM
    • /etc/init.d/oracleasm createdisk VOLX /dev/sdX1 (VOLX is what you want to name the ASM volume. Ex: VOL1, REPOLOGS01, etc.
  8. Link raw device in correct database directory
    • In our environment, each database instance has it's own directory under /u01/oradata/<instance name>
    • ln -sf /dev/raw/rawY /u01/oradata/<instance name>/asmdiskX (where X is the same number as VOLX you gave it when stamped with ASM)
  9. Change permissions on /dev/raw/rawY. Needs to be owned by the oracle user and the oracle dba group. In our environment, the oracle user is oracle and the dba group is dba.
    • chown oracle:dba /dev/raw/rawY
    • chmod g+rw /dev/raw/rawY
  10. Modify udev so raw device holds permissions after reboot
    • vi /etc/udev/rules.d/60-raw.rules
    • Add the following line. Change rawY to whatever you named the raw device in /dev/raw:
      • ACTION=="add", KERNEL=="rawY", OWNER="oracle", GROUP=="dba", MODE=="0660"
  11. Tell the DBA's their disk is ready.

ARE YOU ROOT?

It is a question we should all ask of ourselves.