In this article, we are going to learn how to create an ASM diskgroup, so here I'm going to show you the complete steps to creating ASM devices and then the ASM disk group.
To create ASM diskgroups you can use asmca (Oracle ASM Configuration Assistant) which is providing a GUI interface. But in this tutorial, we are going to use the manual method. So here we are going to create a diskgroup with EXTERNAL REDUNDANCY.
If you are using a VMware environment then you need to add a new disk and create a partition in this disk using the fdisk command, create an ASM disk using the below command as the root user.
oracleasm createdisk VOL1 /dev/sdb1
Check existing disk and diskgroup information
How to check ASM disk and diskgroup information.
ASM Disk
SQL> select name from v$asm_disk;
NAME
------------------------------
VOL2
VOL3
ASM Diskgroup
SQL> select name from v$asm_diskgroup;
NAME
------------------------------
FRA
DATA
How do I make a disk group?
Using the below command we can create diskgroup ASM with external redundancy.
How to create ASM Disk group?
CREATE DISKGROUP DATA
EXTERNAL REDUNDANCY
DISK 'ORCL:VOL1';
OR
CREATE DISKGROUP DATA
EXTERNAL REDUNDANCY
DISK 'ORCL:VOL1', 'ORCL:VOL2';
The above command will create an ASM diskgroup called DATA that contains the disks marked VOL1 and VOL2 by ASMlib.
How to Mount and Dismount ASM Diskgroup
If the diskgroup is not in use you can dismount and mount the diskgroup using the below commands.
Dismount Diskgroup
SQL> alter diskgroup DISK_GROUP_NAME dismount force;
Diskgroup altered.
Mount Diskgroup
SQL> alter diskgroup DISK_GROUP_NAME mount;
Diskgroup altered.
Drop Diskgroup
If you want to drop a diskgroup, then you can use the below command.
SQL> drop diskgroup DISK_GROUP_NAME including contents;
Diskgroup dropped.
2 thoughts on “How to create ASM diskgroup”