Showing posts with label ASM. Show all posts
Showing posts with label ASM. Show all posts

Wednesday, September 30, 2015

Adding disks to ASM library

[root@rac1 Desktop]# cd /dev

[root@rac1 dev]# ls sd*
sda  sda1  sda2  sdb  sdb1  sdc  sdc1  sdd  sdd1  sde  sde1  sdf  sdg

[root@rac1 dev]# /usr/sbin/oracleasm listdisks
DISK1
DISK2
DISK3
DISK4

[root@rac1 dev]# fdisk /dev/sdf

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xd8725891.
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):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-652, default 652):
Using default value 652

Command (m for help): p

Disk /dev/sdf: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xd8725891

   Device Boot      Start         End      Blocks   Id  System
/dev/sdf1               1         652     5237158+  83  Linux

Command (m for help): w        
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

[root@rac1 dev]# ls sd*
sda  sda1  sda2  sdb  sdb1  sdc  sdc1  sdd  sdd1  sde  sde1  sdf  sdf1  sdg

[root@rac1 dev]# fdisk /dev/sdg
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x3ca5b760.
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):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-652, default 652):
Using default value 652

Command (m for help): p

Disk /dev/sdg: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x3ca5b760

   Device Boot      Start         End      Blocks   Id  System
/dev/sdg1               1         652     5237158+  83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@rac1 dev]# ls sd*
sda  sda1  sda2  sdb  sdb1  sdc  sdc1  sdd  sdd1  sde  sde1  sdf  sdf1  sdg  sdg1

[root@rac1 dev]# /usr/sbin/oracleasm createdisk DISK5 /dev/sdf1
Writing disk header: done
Instantiating disk: done

[root@rac1 dev]# /usr/sbin/oracleasm createdisk DISK6 /dev/sdg1
Writing disk header: done
Instantiating disk: done

[root@rac1 dev]# /usr/sbin/oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...

[root@rac1 dev]# /usr/sbin/oracleasm listdisks
DISK1
DISK2
DISK3
DISK4
DISK5
DISK6

[root@rac1 dev]#

Wednesday, September 16, 2015

Adding disk group to ASM instance using ASMCA


Here is the step by step process on how to add diskgroup to existing ASM instance via ASMCA.

on cmd prompt set the ASM insatance and then invoke asmca. by using below cmd.

$ asmca















Wednesday, June 24, 2015

create shared disks (vdi) on Virtualbox for ASM - vboxmanage command line

                                        vboxmanage command line 

For our scenario :


Lets create shared disks (vdi) on Virtualbox for ASM setup. 


If you are getting error like below make sure you have virtual-box set in your environmental path:





In my case I have to add "C:\Program Files\Oracle\VirtualBox\" to my path. To add it to your environmental path goto :


Startup >> computer (right click) >> properties >> advanced system settings >> environmental variables >>  



  1. Click on start
  2. Right click on Computer
  3. Click Properties
  4. Click Advanced system settings
  5. Click Environment Variables
  6. Go to system variables
  7. find Path and edit it
  8. add your file location at the end of the box.




Add your virtual box installed path, usually c\programe files \ oracle


Now test the vboxmanage cmd :


You will get something like this if you have any virtual machines created.


Microsoft Windows [Version 6.1.7601]

Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\arvind>vboxmanage list vms

"linux1" {69b544d2-bf64-4f83-a525-a7f2dd2007e7}


Now  lets create a shared asm drive for ASM :


Note : Always pick a different location, but make sure they are outside the existing VM directory.


$ mkdir C:/VirtualBox/

$ cd C:/VirtualBox/
$
$ # Create the disks and associate them with VirtualBox as virtual media.

VBoxManage createhd --filename asm1.vdi --size 5120 --format VDI --variant Fixed


C:\Virtualdisks>VBoxManage createhd --filename asm1.vdi --size 5120 --format VDI

 --variant Fixed
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Disk image created. UUID: c8a5ef46-7304-4ea0-b685-e1efbf6ab41e

$ # Connect them to the VM.


VBoxManage storageattach linux1 --storagectl "SATA" --port 1 --device 0 --type hdd --medium asm1.vdi --mtype shareable



$ # Make shareable.


$ VBoxManage modifyhd asm1.vdi --type shareable


We now have shared disks added to Virtual box.






We can also add these shared disks via Graphical interface :


See below for instructions:



Step 1 :


Select >> add hard disks >>





Step 2:


select vdi




Step 3


select fixed size



Step 4

it will be added now.



Step 5


select (virtual box top left) File >> virtual Media manager >> select disk you want to modify >> right click >> click modify




Step 6


Select modify and close.





Note : 


If you are going to use this for RAC setup. make sure you attach this shared disks to both of your environments.