Categories
Blog

Adding New ASM Disks

We have decided to add some new disks to our ASM and migrate the data, Easy
First as root check we can see the new disks on the machine:

 ./fdisk -l
Disk /dev/sdc: 118.1 GB, 118115794944 bytes – Existing FRA Disk
 255 heads, 63 sectors/track, 14360 cylinders
 Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
 /dev/sdc1 1 14360 115346668+ 83 Linux
Disk /dev/sdg: 118.1 GB, 118115794944 bytes – New FRA Disk
 255 heads, 63 sectors/track, 14360 cylinders
 Units = cylinders of 16065 * 512 = 8225280 bytes<
Device Boot Start End Blocks Id System
 /dev/sdg1 1 14360 115346668+ 83 Linux

If we log onto our ASM, we can see the current disks mounted:

ASMCMD> lsdg
 State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
 MOUNTED EXTERN N 512 4096 1048576 1048586 396010 0 396010 0 Y DATA/
 MOUNTED EXTERN N 512 4096 1048576 112643 108494 0 108494 0 N FRA /

Lets create the new disk.

/etc/init.d/oracleasm createdisk FRA2 /dev/sdg
[root@sbin]# ./oracleasm listdisks
 DATA1
 FRA1
 FRA2

Now that we have listed disks, we can find where they are attached

[root@sbin]# ./oracleasm querydisk -d FRA2
 Disk "FRA2" is a valid ASM disk on device /dev/sdg1[8,97]

We can use the above to locate physical disk in /dev

[root@dev]# ls -l * | grep 8, | grep 97
 brw-r----- 1 root disk 8, 97 May 5 21:44 sdg1

As for the commands we need to issue to modify the FRA diskgroup we would need to do the below:

SQL> select path from v$asm_disk;
PATH
 --------------------------------------------------------------------------------
 ORCL:DATA1
 ORCL:FRA1
 ORCL:FRA2
SQL> show parameter limit
NAME TYPE VALUE
 ------------------------------------ ----------- ------------------------------
 asm_power_limit integer 1
SQL> ALTER DISKGROUP FRA DROP DISK 'FRA1' ADD DISK 'ORCL:FRA2';

Monitor the migration using the below, increase power if needed:

SQL>select * from v$asm_operation;
GROUP_NUMBER OPERA STAT POWER ACTUAL SOFAR EST_WORK EST_RATE EST_MINUTES ERROR_CODE
 ------------ ----- ---- ---------- ---------- ---------- ---------- ---------- ----------- --------------------------------------------
 2 REBAL RUN 1 1 3810 15530 2351 4
SQL> select INST_ID, OPERATION, STATE, POWER, SOFAR, EST_WORK, EST_RATE, EST_MINUTES from GV$ASM_OPERATION;
INST_ID OPERA STAT POWER SOFAR EST_WORK EST_RATE EST_MINUTES
 ---------- ----- ---- ---------- ---------- ---------- ---------- -----------
 2 REBAL WAIT 1
 1 REBAL RUN 1 6120 15530 2410 3

If you want to pause:

 ALTER DISKGROUP DATA REBALANCE POWER 0;

Once finished we can review the disks by issuing the command below, we can see FRA1 is closed and we have moved to the new disk.

SQL> l
 1 select group_number,mount_status, path
 2* from v$asm_disk
 SQL> /
GROUP_NUMBER MOUNT_S PATH
 ------------ ------- --------------------------------------------------
 0 CLOSED ORCL:FRA1
 1 CACHED ORCL:DATA1
 2 CACHED ORCL:FRA2