Move ASM disk across storage online

This is a way you can use to copy/move your ASM disks to new location
without the need to stop your instance. it include command to be run
by root and by asm admin

1. creating the new disks(LUN) as ASM devices (run as root)

[[email protected] ~]# /etc/init.d/oracleasm listdisks
DATA1
OCR1
[[email protected] ~]# /etc/init.d/oracleasm createdisk DATA2 /dev/sdb8
Marking disk "DATA2" as an ASM disk:
[ OK ]
[[email protected] ~]#
[[email protected] ~]# /etc/init.d/oracleasm listdisks
DATA1
DATA2
OCR1

2. List disk in disk-group (run as asmadmin)

SQL> select GROUP_NUMBER,NAME,STATE,TOTAL_MB from v$asm_diskgroup ;
GROUP_NUMBER NAME
STATE TOTAL_MB
------------ ------------------------------ ----------- ----------
1 OCR
MOUNTED
964
2 DATA
MOUNTED
4777
SQL> select NAME,GROUP_NUMBER,REDUNDANCY from v$asm_disk ;
NAME
GROUP_NUMBER REDUNDA
------------------------------ ------------ -------
0 UNKNOWN
DATA1
2 UNKNOWN
OCR1
1 UNKNOWN

3. Adding disk to DATA disk-group (run as asdmadmin)

SQL> ALTER DISKGROUP DATA REBALANCE POWER 0 ;
Diskgroup altered.
SQL> ALTER DISKGROUP DATA ADD DISK 'ORCL:DATA2' NAME DATA2 ;
Diskgroup altered.
SQL> ALTER DISKGROUP DATA DROP DISK DATA1 ;
Diskgroup altered.
SQL> ALTER DISKGROUP data REBALANCE POWER 1;
Diskgroup altered.
SQL> select NAME,GROUP_NUMBER,REDUNDANCY from v$asm_disk ;
NAME
GROUP_NUMBER REDUNDA
------------------------------ ------------ -------
0 UNKNOWN
DATA1
1 UNKNOWN
DATA2
1 UNKNOWN
OCR1

Note that DATA1 was marked as DROP , it will stop showing once all data sync to DATA2
the process can be monitored by this query (run as asmadmin)

SELECT g.name "Diskgroup",
100*(max((d.total_mb-d.free_mb)/d.total_mb)-min((d.total_mb-d.free_mb)/d.total_mb))/max((d.total_mb-d.free_mb)/d.total_mb) "Imbalance",
100*(max(d.total_mb)-min(d.total_mb))/max(d.total_mb) "Variance",
100*(min(d.free_mb/d.total_mb)) "MinFree",
count(*) "DiskCnt",
g.type "Type"
FROM v$asm_disk d, v$asm_diskgroup g
WHERE d.group_number = g.group_number and
--d.group_number = 1 and
d.state = 'NORMAL' and
d.mount_status = 'CACHED'
12 GROUP BY g.name, g.type;

Diskgroup
Imbalance Variance MinFree
------------------------------ ---------- ---------- ---------- ----------
Type
------
OCR
0
EXTERN
DATA
EXTERN
•
0
DiskCnt
0 63.3817427 1
0 59.5143395 1
Posted in database tips Tagged with: ,