Skip to content

Create diskgroup in ASM

Steps for creating diskgroup in ASM (Single Node)

 

Step 1: Add new HDD to server and done partition. Here I added two HDD

[root@asmoracle ~]# fdisk /dev/sde
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklab el
Building a new DOS disklabel. 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)

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 or +size or +sizeM or +sizeK (1-130, default 130):
Using default value 130

Command (m for help): p

Disk /dev/sde: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sde1 1 130 1044193+ 83 Linux

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

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.

Step 2 :  Just check existing Diskgroup in ASM

[root@asmoracle ~]# oracleasm listdisks
DISK1
DISK2

Step 3:  now try to create new disk in asm

[root@asmoracle ~]# oracleasm createdisk DISK3 /dev/sde1
Writing disk header: done
Instantiating disk: done

[root@asmoracle ~]# oracleasm createdisk DISK4 /dev/sdf1
Writing disk header: done
Instantiating disk: done

Step 4: Verifying asm disk label

[root@asmoracle ~]# oracleasm querydisk /dev/sde1
Device "/dev/sde1" is marked an ASM disk with the label "DISK3"
[root@asmoracle ~]# oracleasm querydisk /dev/sdf1
Device "/dev/sdf1" is marked an ASM disk with the label "DISK4"

Step 5 : listdisks

[root@asmoracle ~]# oracleasm listdisks
DISK1
DISK2
DISK3
DISK4

Step 6:  Checking diskgroup state

SQL> select path,header_status from v$asm_disk;

PATH
--------------------------------------------------------------------------------
HEADER_STATU
------------
/dev/oracleasm/disks/DISK4
PROVISIONED

/dev/oracleasm/disks/DISK3
PROVISIONED

/dev/oracleasm/disks/DISK2
MEMBER

/dev/oracleasm/disks/DISK1
MEMBER

 

PROVISINED -- It is available to be added diskgroup or create diskgroup. It's configuration done by ASMLIB

Step 7 : create diskgroup

SQL> CREATE DISKGROUP FRA EXTERNAL REDUNDANCY DISK '/dev/oracleasm/disks/DISK3','/dev/oracleasm/disks/DISK4';

Diskgroup created.

SQL> select path,header_status from v$asm_disk;

PATH
----------------------------------------------------------------------------------------------------
HEADER_STATU
------------
/dev/oracleasm/disks/DISK2
MEMBER

/dev/oracleasm/disks/DISK1
MEMBER

/dev/oracleasm/disks/DISK4
MEMBER

/dev/oracleasm/disks/DISK3
MEMBER

 
No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: