Create ASM diskgroup on Linux: Easy Step-by-step guide

Create ASM diskgroup on Linux

In this article, I will provide detailed guide on how to create ASM diskgroup on linux. We’ll walk you through each step of the process with proper screenshots.

1.First check all the asm disks details on your server by running the command lsblk -fm:

Create ASM diskgroup on Linux: Easy Step-by-step guide

2.Connect to the ASM instance as a grid user:

[root@node1 disks]# sudo su - grid
Last login: Mon Mar 11 12:57:36 IST 2024 on pts/0

[grid@node1 ~]$ ps -ef|grep pmon
grid      7637     1  0 11:52 ?        00:00:00 asm_pmon_+ASM1
grid     30451 30379  0 13:00 pts/0    00:00:00 grep --color=auto pmon

[grid@node1 ~]$ . oraenv
ORACLE_SID = [grid] ? +ASM1
ORACLE_HOME = [/home/oracle] ? /u01/app/19.3.0/grid
The Oracle base has been set to /u01/app/grid

[grid@node1 ~]$ env|grep ORA
ORACLE_SID=+ASM1
ORACLE_BASE=/u01/app/grid
ORACLE_HOME=/u01/app/19.3.0/grid

[grid@node1 ~]$ sqlplus / as sysasm
SQL*Plus: Release 19.0.0.0.0 - Production on Mon Mar 11 13:01:30 2024
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle.  All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> show parameter instance_name

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
instance_name                        string      +ASM1

3.Check the existing diskgroup and disk details:

col PATH for a40
col DG_NAME for a15
col DG_STATE for a10
col FAILGROUP for a20
set lines 750 pages 9999

select dg.name dg_name, dg.state dg_state, dg.type, d.disk_number dsk_no,
d.path,d.total_mb,d.free_mb, d.mount_status, d.FAILGROUP, d.state 
from v$asm_diskgroup dg, v$asm_disk d
where dg.group_number=d.group_number
order by dg_name, dsk_no;
Create ASM diskgroup on Linux: Easy Step-by-step guide

4.Now find the available disk to add to any ASM diskgroup or to create ASM diskgroup.If you can not find any available disk then you can follow my article ASM disk creation in Oracle VirtualBox to create the ASM disk.

SQL> col PATH for a55
select path, group_number group_#, disk_number disk_#, mount_status,header_status, state, total_mb, free_mb from v$asm_disk where header_status='CANDIDATE' or header_status='FORMER' order by 1 ;
Create ASM diskgroup on Linux: Easy Step-by-step guide

5. Create ASM diskgroup called FRADG with external redundancy with the disk ‘/dev/oracleasm/disks/FRA’

SQL> create diskgroup FRADG external redundancy disk '/dev/oracleasm/disks/FRA';

Diskgroup created.

You can mention size also while creating the diskgroup.If you do not mention the size then it will take the whole disk size (you can check the size from the command lsblk -fm).

SQL> CREATE DISKGROUP FRADG EXTERNAL REDUNDANCY DISK '/dev/oracleasm/disks/FRA' SIZE 102400M;

You can also use different available disks(Check step 4 script for available disks) to create a diskgroup by running the below command. I am assuming that FRA1, FRA2 and FRA3 disks are available to create diskgroup.

CREATE DISKGROUP FRADG EXTERNAL REDUNDANCY 
DISK '/dev/oracleasm/disks/FRA1' SIZE 102400 M 
DISK '/dev/oracleasm/disks/FRA2' SIZE 102400 M 
DISK '/dev/oracleasm/disks/FRA3' SIZE 102400 M;

6. Verify the asm diskgroup:

col PATH for a40
col DG_NAME for a15
col DG_STATE for a10
col FAILGROUP for a20
set lines 750 pages 9999

select dg.name dg_name, dg.state dg_state, dg.type, d.disk_number dsk_no,
d.path,d.total_mb,d.free_mb, d.mount_status, d.FAILGROUP, d.state 
from v$asm_diskgroup dg, v$asm_disk d
where dg.group_number=d.group_number
order by dg_name, dsk_no;
Create ASM diskgroup on Linux: Easy Step-by-step guide

We can see diskgroup FRADG has been created successfully.

This Post Has One Comment

Leave a Reply