ASM Operation: Rename an ASM disk

Renaming disk with 12c

SQL> alter diskgroup data2 dismount;
   Diskgroup altered.
SQL> alter diskgroup data2 mount restricted;
   Diskgroup altered.
Then use the following SQL to rename the disks. 
SQL> alter diskgroup data2 rename disk 'DATA2_0001' to 'DATA2_VMAX_0001', 'DATA2_0000' to 'DATA2_VMAX_0000';
Diskgroup altered.

 

Renaming disk with 11g

[grid@grac41 ~]$ asmcmd lsdg DATA
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  NORMAL  N         512   4096  1048576     40944    18561            10236            4162              0             N  DATA/

SQL> @dg1

DG_NAME    DG_STATE   TYPE    DSK_NO MOUNT_S HEADER_STATU MODE_ST STATE    PATH 			  FAILGROUP
---------- ---------- ------ ------- ------- ------------ ------- -------- ------------------------------ ---------------
DATA	   MOUNTED    NORMAL	   0 CACHED  MEMBER	  ONLINE  NORMAL   /dev/asmdisk1_udev_sdb1	  DATA_0000
DATA	   MOUNTED    NORMAL	   1 CACHED  MEMBER	  ONLINE  NORMAL   /dev/asmdisk1_udev_sdc1	  DATA_0001
DATA	   MOUNTED    NORMAL	   2 CACHED  MEMBER	  ONLINE  NORMAL   /dev/asmdisk1_udev_sdd1	  DATA_0002
DATA	   MOUNTED    NORMAL	   3 CACHED  MEMBER	  ONLINE  NORMAL   /dev/asmdisk1_udev_sde1	  DATA_0003

SQL> ALTER DISKGROUP DATA  REBALANCE POWER 11 WAIT;
SQL> ALTER DISKGROUP DATA  DROP DISK DATA_0003;

DG_NAME    DG_STATE   TYPE   NAME	 DSK_NO MOUNT_S HEADER_STATU MODE_ST STATE    PATH			     FAILGROUP
---------- ---------- ------ ---------- ------- ------- ------------ ------- -------- ------------------------------ ---------------
DATA	   MOUNTED    NORMAL DATA_0000	      0 CACHED	MEMBER	     ONLINE  NORMAL   /dev/asmdisk1_udev_sdb1	     DATA_0000
DATA	   MOUNTED    NORMAL DATA_0001	      1 CACHED	MEMBER	     ONLINE  NORMAL   /dev/asmdisk1_udev_sdc1	     DATA_0001
DATA	   MOUNTED    NORMAL DATA_0002	      2 CACHED	MEMBER	     ONLINE  NORMAL   /dev/asmdisk1_udev_sdd1	     DATA_0002
DATA	   MOUNTED    NORMAL DATA_0003	      3 CACHED	MEMBER	     ONLINE  DROPPING /dev/asmdisk1_udev_sde1	     DATA_0003

DISK_GRP		       GROUP_NUMBER OPERA EST_MINUTES
------------------------------ ------------ ----- -----------
DATA					  1 REBAL	   25

After some time
DG_NAME    DG_STATE   TYPE   NAME	 DSK_NO MOUNT_S HEADER_STATU MODE_ST STATE    PATH			     FAILGROUP
---------- ---------- ------ ---------- ------- ------- ------------ ------- -------- ------------------------------ ---------------
DATA	   MOUNTED    NORMAL DATA_0000	      0 CACHED	MEMBER	     ONLINE  NORMAL   /dev/asmdisk1_udev_sdb1	     DATA_0000
DATA	   MOUNTED    NORMAL DATA_0001	      1 CACHED	MEMBER	     ONLINE  NORMAL   /dev/asmdisk1_udev_sdc1	     DATA_0001
DATA	   MOUNTED    NORMAL DATA_0002	      2 CACHED	MEMBER	     ONLINE  NORMAL   /dev/asmdisk1_udev_sdd1	     DATA_0002
					      1 CLOSED	FORMER	     ONLINE  NORMAL   /dev/asmdisk1_udev_sde1

Now cleanup disk so we can add it again to our +DATA DG 
# dd if=/dev/zero  of=/dev/asmdisk1_udev_sde1 bs=1024 count=1024
DG_NAME    DG_STATE   TYPE   NAME	 DSK_NO MOUNT_S HEADER_STATU MODE_ST STATE    PATH			     FAILGROUP
---------- ---------- ------ ---------- ------- ------- ------------ ------- -------- ------------------------------ ---------------
					      1 CLOSED	CANDIDATE    ONLINE  NORMAL   /dev/asmdisk1_udev_sde1

Change udev rules and rename disk from /dev/asmdisk1_udev_sde1 to asm_data_10G_disk3
KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VBd3b6af8f-7dda2f15", 
  NAME="asm_data_10G_disk3", OWNER="grid", GROUP="asmadmin", MODE="0660"

Remove old disk device and restart udev
[root@grac41 ~]# rm  /dev/asmdisk1_udev_sde1
rm: remove block special file `/dev/asmdisk1_udev_sde1'? y
[root@grac41 ~]#  ~/start_udev.sh
Starting udev:                                             [  OK  ]
brw-rw----. 1 grid asmadmin 8, 113 Jul 10 08:14 /dev/asm_data_10G_disk3
brw-rw----. 1 grid asmadmin 8,  65 Jul 10 08:14 /dev/asmdisk1_udev_sdb1
brw-rw----. 1 grid asmadmin 8,  81 Jul 10 08:14 /dev/asmdisk1_udev_sdc1
brw-rw----. 1 grid asmadmin 8,  97 Jul 10 08:14 /dev/asmdisk1_udev_sdd1
brw-rw----. 1 grid asmadmin 8, 129 Jul 10 08:14 /dev/asmdisk_fra1
brw-rw----. 1 grid asmadmin 8, 145 Jul 10 08:14 /dev/asmdisk_fra2
brw-rw----. 1 grid asmadmin 8,  17 Jul 10 08:14 /dev/asm_ocr_11204_2G_disk1
brw-rw----. 1 grid asmadmin 8,  33 Jul 10 08:14 /dev/asm_ocr_11204_2G_disk2
brw-rw----. 1 grid asmadmin 8,  49 Jul 10 08:14 /dev/asm_ocr_11204_2G_disk3

Add new disk to diskgroup and monitory rebalance operation
SQL> ALTER DISKGROUP DATA  ADD DISK '/dev/asm_data_10G_disk3';
SQL> select dg.name dg_name,  dg.state dg_state,  dg.type,d.name, d.DISK_NUMBER dsk_no, d.MOUNT_STATUS, d.HEADER_STATUS, d.MODE_STATUS,
    	d.STATE, d. PATH, d.FAILGROUP  FROM V$ASM_DISK d,  v$asm_diskgroup dg
     where dg.group_number(+)=d.group_number and  dg.name='DATA' order by dg_name, dsk_no;

DG_NAME    DG_STATE   TYPE   NAME	 DSK_NO MOUNT_S HEADER_STATU MODE_ST STATE    PATH			     FAILGROUP
---------- ---------- ------ ---------- ------- ------- ------------ ------- -------- ------------------------------ ---------------
DATA	   MOUNTED    NORMAL DATA_0000	      0 CACHED	MEMBER	     ONLINE  NORMAL   /dev/asmdisk1_udev_sdb1	     DATA_0000
DATA	   MOUNTED    NORMAL DATA_0001	      1 CACHED	MEMBER	     ONLINE  NORMAL   /dev/asmdisk1_udev_sdc1	     DATA_0001
DATA	   MOUNTED    NORMAL DATA_0002	      2 CACHED	MEMBER	     ONLINE  NORMAL   /dev/asmdisk1_udev_sdd1	     DATA_0002
DATA	   MOUNTED    NORMAL DATA_0003	      3 CACHED	MEMBER	     ONLINE  NORMAL   /dev/asm_data_10G_disk3	     DATA_0003

SQL> select	g.name disk_grp, o.group_number, operation , est_minutes from v$asm_operation o,  v$asm_diskgroup g
    	 where g.group_number = o.group_number;
DISK_GRP		       GROUP_NUMBER OPERA EST_MINUTES
------------------------------ ------------ ----- -----------
DATA					  1 REBAL	    8
--> In about 8 minutes the reblance operation will be finished

 

Leave a Reply

Your email address will not be published. Required fields are marked *