maandag 13 oktober 2014

Increase the size of a LUN and Oracle ASM Disk without rebooting

How to increase the size of an oracle ASM-Diks without rebooting

1.       Increase the size of the LUN on your NAS

2.       Find the names of the block devices in question which should be rescanned. This is done by running the multipath command :

[root@node1 ~]# multipath –ll
oracle_db_data_lun01 (360002ac0000000005f00023e000046a1) dm-3 3PARdata,VV
[size=500G][features=0][hwhandler=0][rw]
\_ round-robin 0 [prio=0][active]
 \_ 0:0:1:247 sdab 65:176 [active][ready]
\_ round-robin 0 [prio=0][enabled]
 \_ 1:0:0:247 sdap 66:144 [active][ready]
\_ round-robin 0 [prio=0][enabled]
 \_ 1:0:1:247 sdbd 67:112 [active][ready]
\_ round-robin 0 [prio=0][enabled]
 \_ 0:0:0:247 sdn  8:208  [active][ready]
               
                The block devices are the names marked in red

3.       Write a 1 to the rescan-file of these block devices.

[root@node1 ~]# echo 1> /sys/block/sdab/device/rescan
[root@node1 ~]# echo 1> /sys/block/sdap/device/rescan
[root@node1 ~]# echo 1> /sys/block/sdbd/device/rescan
[root@node1 ~]# echo 1> /sys/block/sdn/device/rescan

Perform a partprobe to inform the OS about the changes.

[root@node1 ~]# partprobe

4.       Issue a resize of the multipath-device

[root@node1 ~]# multipathd -k
Multipathd> resize map oracle_db_data_lun_01

5.       Recreate the partition table using fdisk. First delete the partition and the create a new one.

[root@node1]# fdisk /dev/mapper/oracle_db_data_lun_01

The number of cylinders for this disk is set to 65270.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): d
Selected partition 1

Command (m for help): u
Changing display/entry units to sectors

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First sector (63-1048575999, default 63): 2048
Last sector or +size or +sizeM or +sizeK (2048-1048575999, default 1048575999):
Using default value 1048575999

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 22: Invalid argument.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.

Next run kpartx to make the changes active :

[root@node1]# kpartx -a /dev/mapper/oracle_db_data_lun_01

6.       Finally we can change the size of the ASM-disk

[grid@node1 ~]$ sqlplus / as sysasm;

SQL*Plus: Release 11.2.0.4.0 Production on Mon Oct 13 12:24:15 2014

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


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

SQL> alter diskgroup ORA_DATA_DG1 resize disk ORA_DATA_DISK01 size 499G;

Diskgroup altered.

SQL>

Geen opmerkingen:

Een reactie posten