Oracle Database

Create Shared ASM disk for RAC : Oracle VM

The first problem i faced during the installation of Oracle RAC was how should i create shared ASM disks. With oracle vm its pretty simple to setup. I am going to demonstrate your how.First of all you have to stop your vm. Then click on your VM’s setting -> Storage -> Controller-> Add a hard disk

adddisk1

Then you can choose the option of creating a new disk. Make sure to create a fixed size storage and not a dynamic allocated, else you will receive error on changing its property to Shareable , later in this blog.

Adddisk2.png

After this now its time to change the property of this disk to shared.

This can be changed from the main setting of the Oracle VM. On the top left of your vm box click on File-> Virtual Medial Manager(Ctrl+D) -> Right Click on your disk(NewVirtualDisk1.vdi) -> Modify(Ctrl+Space)

Now make your disk shareableadddisk3

Your shared disk is ready now you can start your vm.

I have already created 4 disks and on starting my vm i could see them.

Ls /dev/sd*

/dev/sdb
/dev/sdc
/dev/sdd
/dev/sde

Next use fdisk command to create the raw disks a primary partition

[root@localhost ~]# fdisk /dev/sdc
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x937ede81.
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-130, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-130, default 130):
Using default value 130
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.

Continue the above operation for next 3 disks.

Now change the permission of the disks to oracle:dba

[root@localhost ~]# chown -R oracle /dev/sdb1
[root@localhost ~]# chgrp -R dba /dev/sdb1

Note: Since you have created a single primary partition out of /dev/sdb hence we change the permissions of /dev/sdb1.

Now these disks /dev/sdb1 , /dev/sdc1, /dev/sdd1, /dev/sde1 will be visible as cadidate disks during the asm installtion.

Wait…. this is not it now if you will reboot the vm all your candidate disks will be gone. You will either have to setup udev rules or create asm diks via asmlib. We will take this up in our next blog.