Pythian Blog: Technical Track

Online resizing of ASM disks

  The SAN administrator has informed us that they have extended the disks. This is the information I had from our client. The disks were labelled:
mpath_compellent_oraarch
 mpath_compellent_oraarch02
 mpath_compellent_oraarch03
  The original size of the disks were 300GB and they had been extended to 600GB. These were multipath disks belonging to the disk diskgroup ARCH, which was being used to store archive logs in ASM. The database was 11.2.0.3 and was in a 2-node RAC configuration. The server was Red Hat Linux 5.9 - 2.6.18-406.el5 - 64bit. I checked the disks using fdisk (as the root user) and got the following: [code language="bash"]fdisk -l /dev/mpath/mpath_compellent_oraarch Disk /dev/mpath/mpath_compellent_oraarch: 322.1 GB, 322122547200 bytes 255 heads, 63 sectors/track, 39162 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/mpath/mpath_compellent_oraarch doesn't contain a valid partition table[/code] This confirmed that the OS was not aware of the size extension.   Firstly, I wanted to confirm that the correct disks had been extended. So the first place to look is in ASM: [code language="sql"]select g.name , d.path , d.os_mb , d.total_mb from v$asm_diskgroup g , v$asm_disk d where g.group_number = d.group_number and g.name = 'ARCH' / NAME PATH OS_MB TOTAL_MB ---------- ------------------------- ---------- ---------- ARCH ORCL:ASMDISK_NEW_ARCH03 307200 307200 ARCH ORCL:ASMDISK_NEW_ARCH01 307200 307200 ARCH ORCL:ASMDISK_NEW_ARCH02 307200 307200 [/code]   Now we need to match these names to those provided by the SAN administrator. Check the directory:
/dev/oracleasm/disks
[code language="bash"]ls -l /dev/oracleasm/disks/ASMDISK_NEW_ARCH* brw-rw---- 1 oracle dba 253, 30 Oct 6 00:35 /dev/oracleasm/disks/ASMDISK_NEW_ARCH01 brw-rw---- 1 oracle dba 253, 29 Oct 6 00:35 /dev/oracleasm/disks/ASMDISK_NEW_ARCH02 brw-rw---- 1 oracle dba 253, 32 Oct 6 00:35 /dev/oracleasm/disks/ASMDISK_NEW_ARCH03 [/code] This gives is the major and minor numbers for the disks - major number is 253 and minor numbers are 30,29 and 32.   Then compare these numbers against the devices listed in:
/dev/mapper
[code language="bash"]ls -l /dev/mapper/mpath_compellent_oraarch* brw-rw---- 1 root disk 253, 30 Oct 6 00:34 /dev/mapper/mpath_compellent_oraarch brw-rw---- 1 root disk 253, 29 Oct 6 00:34 /dev/mapper/mpath_compellent_oraarch02 brw-rw---- 1 root disk 253, 32 Oct 6 00:34 /dev/mapper/mpath_compellent_oraarch03 [/code] The numbers match showing that they are the same devices.   Now we need to find the actual disks that make up the multipath devices. [code language="bash"]multipath -l Output truncated for brevity mpath_compellent_oraarch03 (36000d310009aa700000000000000002b) dm-32 COMPELNT,Compellent Vol [size=300G][features=1 queue_if_no_path][hwhandler=0][rw] \_ round-robin 0 [prio=0][active] \_ 13:0:0:3 sdfm 130:128 [active][undef] \_ 11:0:0:3 sdgd 131:144 [active][undef] mpath_compellent_oraarch02 (36000d310009aa700000000000000002a) dm-29 COMPELNT,Compellent Vol [size=300G][features=1 queue_if_no_path][hwhandler=0][rw] \_ round-robin 0 [prio=0][active] \_ 12:0:0:2 sdfi 130:64 [active][undef] \_ 14:0:0:2 sdfk 130:96 [active][undef] mpath_compellent_oraarch (36000d310009aa7000000000000000026) dm-30 COMPELNT,Compellent Vol [size=300G][features=1 queue_if_no_path][hwhandler=0][rw] \_ round-robin 0 [prio=0][active] \_ 13:0:0:1 sdfj 130:80 [active][undef] \_ 11:0:0:1 sdgc 131:128 [active][undef] [/code] From here we can see the disks:
/dev/sdfm
 /dev/sdgd
 /dev/sdfi
 /dev/sdfk
 /dev/sdfj
 /dev/sdgc
We need to find this information on the other node as well, as the underlying disk names will very likely be different on the other server.   Now for each disk we need to rescan the disk to register the new size. To do this we need to the following for each disk on both nodes: [code language="bash"]echo 1 > /sys/block/sdfm/device/rescan [/code] Then we can check each disk to make sure it has successfully been extended: [code language="bash"]fdisk -l /dev/sdfm Disk /dev/sdfm: 644.2 GB, 644245094400 bytes 255 heads, 63 sectors/track, 78325 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sdfm doesn't contain a valid partition table [/code] Looks good - once done on all nodes we can then extend the multipath devices for each device name on both nodes: [code language="bash"]multipathd -k'resize map mpath_compellent_oraarch' ok [/code] Then we can check the multipath device disk size: [code language="bash"]fdisk -l /dev/mpath/mpath_compellent_oraarch Disk /dev/mpath/mpath_compellent_oraarch: 644.2 GB, 644245094400 bytes 255 heads, 63 sectors/track, 78325 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/mpath/mpath_compellent_oraarch doesn't contain a valid partition table [/code] Looks good - once done on both nodes we can then resize the ASM disks within ASM: [code language="sql"]SQL> select g.name , d.path , d.os_mb , d.total_mb from v$asm_diskgroup g , v$asm_disk d where g.group_number = d.group_number and g.name = 'ARCH' / NAME PATH OS_MB TOTAL_MB ---------- ------------------------- ---------- ---------- ARCH ORCL:ASMDISK_NEW_ARCH03 614400 307200 ARCH ORCL:ASMDISK_NEW_ARCH01 614400 307200 ARCH ORCL:ASMDISK_NEW_ARCH02 614400 307200 SQL> alter diskgroup ARCH resize all; Diskgroup altered. SQL> select g.name , d.path , d.os_mb , d.total_mb from v$asm_diskgroup g , v$asm_disk d where g.group_number = d.group_number and g.name = 'ARCH' / NAME PATH OS_MB TOTAL_MB ---------- ------------------------- ---------- ---------- ARCH ORCL:ASMDISK_NEW_ARCH03 614400 614400 ARCH ORCL:ASMDISK_NEW_ARCH01 614400 614400 ARCH ORCL:ASMDISK_NEW_ARCH02 614400 614400 [/code] The disks and diskgroup were successfully resized.   Discover more about our expertise in Database Management.

No Comments Yet

Let us know what you think

Subscribe by email