Moneycontrol Brokerage Recos

Sunday, April 24, 2016

Add a new ASM disk to an existing ASM Diskgroup.



Suppose your DATAGROUP1 diskgroup got filled up over defined threshold and there is nothing inside there to be purged in order to reclaim the space then you will need to add some space to that exising Diskgroup.

In that case, Systems Team will add a new HDD device to the host and represent that as a LUN in there and root user will have to create a new ASM disk for that newly added HDD device to be unsed in existing ASM diskgroup.

In our case, new HDD device /dev/sdm1 added on the host as below.


root@rac1 ~]# fdisk -l /dev/sdm

Disk /dev/sdm: 322.1 GB, 322122547200 bytes
255 heads, 63 sectors/track, 39162 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot   Start     End   Blocks  Id System
/dev/sdm1        1    39162  314568733+ 83 Linux


Here lets verify the ASM disks already created on the host using below command.

[root@rac1 ~]# /etc/init.d/oracleasm listdisks
DATA22
DATA23
DATA24
DATA25
DATA26
DATA27
DATA28
DATA29
RECO4


Now let's create a new ASM disk on the new device added as below.


[root@rac1 ~]# /etc/init.d/oracleasm createdisk DATA30 /dev/sdm1
Marking disk "DATA30" as an ASM disk:           [ OK ]


Again verify if new ASM disk created above is listed now.

[root@rac1 ~]# /etc/init.d/oracleasm listdisks
DATA22
DATA23
DATA24
DATA25
DATA26
DATA27
DATA28
DATA29
DATA30     --- Here new ASM disk is created now.
RECO4


Now, it is time to login in ASM instance at SQL prompt and make sure if the new disk is PROVISIONED.

[+ASM]-->sqlplus "/as sysasm"
SQL*Plus: Release 11.2.0.3.0 Production on Sat Mar 12 16:46:09 2016

Copyright (c) 1982, 2011, Oracle. All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Automatic Storage Management option

SQL> select path, header_status from v$asm_disk order by 1;

PATH           HEADER_STATUS
------------------------- ------------------------------------
ORCL:DATA22        MEMBER
ORCL:DATA23        MEMBER
ORCL:DATA24        MEMBER
ORCL:DATA25        MEMBER
ORCL:DATA26        MEMBER
ORCL:DATA27        MEMBER
ORCL:DATA28        MEMBER
ORCL:DATA29        MEMBER
ORCL:DATA30        PROVISIONED
ORCL:RECO4        MEMBER

10 rows selected.


Note : Above we can see new ASM disk created above is PROVISIONED.


Below is the command just to note down the current status/usage of existing ASM diskgroup DATAGROUP1

SQL> select NAME,TOTAL_MB,FREE_MB from v$asm_diskgroup;

NAME
------------------------------------------------------------------------------------------
 TOTAL_MB  FREE_MB
---------- ----------
DATAGROUP1
  6498256   292494

RECOGROUP1
  307196   177404




Let's add the new ASM disk to the diskgroup now.


SQL> alter DISKGROUP DATAGROUP1 ADD DISK 'ORCL:DATA30';

Diskgroup altered.


Again lets verify the new size of ASM diskgroup.


SQL> select NAME,TOTAL_MB,FREE_MB from v$asm_diskgroup;

NAME        TOTAL_MB  FREE_MB
----------------- -------------- ---------------
DATAGROUP1  6805452   599686
RECOGROUP1  307196    177404



Finally we can see that newly added ASM disk is the member of the diskgroup using below command.

SQL> select path, header_status from v$asm_disk order by 1;

PATH           HEADER_STATUS
------------------------- ------------------------------------
ORCL:DATA22        MEMBER
ORCL:DATA23        MEMBER
ORCL:DATA24        MEMBER
ORCL:DATA25        MEMBER
ORCL:DATA26        MEMBER
ORCL:DATA27        MEMBER
ORCL:DATA28        MEMBER
ORCL:DATA29        MEMBER
ORCL:DATA30        MEMBER
ORCL:RECO4        MEMBER

10 rows selected.


Hope it would help someone.....!!