Oracle Database

Migrate ASM Diskgroup to another storage

ASM Storage migration

In this post I will describe in step by step how to Migrate Oracle ASM Diskgroups to another Storage in Online mode without downtime.

In my Case here I am migrating all 3 data disks (DISK01, DISK02, DISK03) to new storage:

NAME                           PATH                   TOTAL_MB 
------------------------------ -------------------- ----------
DISK01                         ORCL:DISK01               20000     --> OLD
DISK02                         ORCL:DISK02               20001     --> OLD
DISK03                         ORCL:DISK03               10001     --> OLD
DISKNEW01                      ORCL:DISKNEW01            20479     --> NEW
DISKNEW02                      ORCL:DISKNEW02            20479     --> NEW
DISKNEW03                      ORCL:DISKNEW03            10239     --> NEW
1. Backup the database using RMAN and validate the Backups

Take an RMAN backups and validate the backups

2. Add storage luns to database nodes and Partition the disks

In my case 3 disks are added.

/dev/sdc - 20G
/dev/sdd - 20G
/dev/sde- 10G

Partition the disks

fdisk  /dev/sdc
fdisk  /dev/sdd
fdisk  /dev/sde
Sample output:

[root@oracle01 tmp]# fdisk  /dev/sdd1
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x28cbe8a9.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-51200, default 1): 1
Last cylinder, +cylinders or +size{K,M,G} (1-51200, default 51200): +20000M
3. Add the newly created disks to ASM
oracleasm createdisk DISKNEW01 /dev/sdc1
oracleasm createdisk DISKNEW02 /dev/sdd1
oracleasm createdisk DISKNEW03 /dev/sde1
--list the disks
oracleasm listdisks
output:
	
	[root@oracle01 ~]# oracleasm createdisk DISKNEW01 /dev/sdc1
	Writing disk header: done
	Instantiating disk: done
	[root@oracle01 ~]#
	[root@oracle01 ~]# oracleasm createdisk DISKNEW01 /dev/sdd1
	Disk "DISKNEW01" already exists
	[root@oracle01 ~]# oracleasm createdisk DISKNEW02 /dev/sdd1
	Writing disk header: done
	Instantiating disk: done
	[root@oracle01 ~]#
	[root@oracle01 ~]#
	[root@oracle01 ~]# oracleasm createdisk DISKNEW03 /dev/sde1
	Writing disk header: done
	Instantiating disk: done
	[root@oracle01 ~]#
	[root@oracle01 ~]# oracleasm listdisks
	DISK01
	DISK02
	DISK03
	DISKNEW01
	DISKNEW02
	DISKNEW03
	
4. Add new disks to existing diskgroup

Connect to grid user and connect sqlplus as /as sysasm

su - grid
sqlplus / as sysasm

Alter the diskgroup to add new disks and wait until the rebalace operation is completed

alter diskgroup DATA add disk
'ORCL:DISKNEW01',
'ORCL:DISKNEW02',
'ORCL:DISKNEW03' rebalance power 11;
Output:
SQL> alter diskgroup DATA add disk
'ORCL:DISKNEW01',
'ORCL:DISKNEW02',
'ORCL:DISKNEW03' rebalance power 11;  2    3    4


Diskgroup altered.

Query to check the rebalance operation:

select * from v$asm_operation;
select * from gv$asm_operation;

verify the newly added disks

SQL>  select name,path, total_mb, state, mount_status, header_status from v$asm_disk;

NAME                           PATH                   TOTAL_MB STATE    MOUNT_S HEADER_STATU
------------------------------ -------------------- ---------- -------- ------- ------------
DISK01                         ORCL:DISK01               20000 NORMAL   CACHED  MEMBER
DISK02                         ORCL:DISK02               20001 NORMAL   CACHED  MEMBER
DISK03                         ORCL:DISK03               10001 NORMAL   CACHED  MEMBER
DISKNEW01                      ORCL:DISKNEW01            20479 NORMAL   CACHED  MEMBER
DISKNEW02                      ORCL:DISKNEW02            20479 NORMAL   CACHED  MEMBER
DISKNEW03                      ORCL:DISKNEW03            10239 NORMAL   CACHED  MEMBER

6 rows selected.

SQL> select name, total_mb, state, type from v$asm_diskgroup;

NAME                             TOTAL_MB STATE       TYPE
------------------------------ ---------- ----------- ------
DATA                               101199 MOUNTED     EXTERN
5. Remove the old disks from the diskgroup

alter diskgroup DATA drop disk
'DISK01',
'DISK02',
'DISK03' rebalance power 11;

Then wait until the rebalance operation completed,

select * from v$asm_operation;
select * from gv$asm_operation;
output:
SQL> select * from gv$asm_operation;

   INST_ID GROUP_NUMBER OPERA STAT      POWER     ACTUAL      SOFAR   EST_WORK EST_RATE   EST_MINUTES ERROR_CODE
---------- ------------ ----- ---- ---------- ---------- ---------- ---------- ---------- ----------- --------------------------------------------
         2            1 REBAL WAIT         11										


         1            1 REBAL RUN          11         11       1070       1155      5798           0    

Verify the disk status after the operation completes:

SQL>  select name,path, total_mb, state, mount_status, header_status from v$asm_disk;
SQL> set linesize 200
SQL> set pagesize 200
SQL> col path for a30


NAME                           PATH                             TOTAL_MB STATE    MOUNT_S HEADER_STATU
------------------------------ ------------------------------ ---------- -------- ------- ------------
                               ORCL:DISK01                             0 NORMAL   CLOSED  FORMER
                               ORCL:DISK02                             0 NORMAL   CLOSED  FORMER
                               ORCL:DISK03                             0 NORMAL   CLOSED  FORMER
DISKNEW01                      ORCL:DISKNEW01                      20479 NORMAL   CACHED  MEMBER
DISKNEW02                      ORCL:DISKNEW02                      20479 NORMAL   CACHED  MEMBER
DISKNEW03                      ORCL:DISKNEW03                      10239 NORMAL   CACHED  MEMBER


SQL> select name, total_mb, state, type from v$asm_diskgroup;

NAME                             TOTAL_MB STATE       TYPE
------------------------------ ---------- ----------- ------
DATA                                51197 MOUNTED     EXTERN

6. Now delete the disk from ASM and release the storage

List the disks

[grid@oracle01 ~]$ oracleasm listdisks;
DISK01
DISK02
DISK03
DISKNEW01
DISKNEW02
DISKNEW03

Delete the disk from ASM

oracleasm deletedisk DISK01
oracleasm deletedisk DISK02
oracleasm deletedisk DISK03

output:
[root@oracle01 ~]# oracleasm deletedisk DISK01
Clearing disk header: done
Dropping disk: done
[root@oracle01 ~]# oracleasm deletedisk DISK02
Clearing disk header: done
Dropping disk: done
[root@oracle01 ~]# oracleasm deletedisk DISK03
Clearing disk header: done
Dropping disk: done

List the disks

[root@oracle01 ~]# oracleasm listdisks;
DISKNEW01
DISKNEW02
DISKNEW03

Hope this helps…

Thanks for reading my post.