为data磁盘组删除其中一个盘(asm external data盘组中有两块盘)

删除磁盘,注意,如果删掉磁盘之后,数据在剩余磁盘中,是否有足够空间存储。如果空间不够,删除工作不会成功。

检查空间够不够:
select a.GROUP_NUMBER,a.DISK_NUMBER,a.NAME ,decode(sign(a.FREE_MB-d.COLD_USED_MB/ 2),1 ,'Y',- 1,'N' ,'N') from v$asm_diskgroup d,v$asm_disk a where a.GROUP_NUMBER = d.GROUP_NUMBER and a.GROUP_NUMBER = 2;  --自己写的语句,如果判断有问题,请一定告知我,谢谢

1.检查磁盘
GROUP_NUMBER GROUP_NAME NAME                 PATH                 STATE      TOTAL_MB
------------ ---------- -------------------- -------------------- -------- ----------
           0 DATA       DATA2                /dev/raw/raw6        NORMAL         8192
           5 FRA        FRA                  /dev/raw/raw5        NORMAL         8192
           0 DATA       DATA                 /dev/raw/raw4        NORMAL         8192
           0 CRS        CRS_0002             /dev/raw/raw3        NORMAL         3072
           0 CRS        CRS_0001             /dev/raw/raw2        NORMAL         3072
           0 CRS        CRS_0000             /dev/raw/raw1        NORMAL         3072

2.删除
SQL> alter diskgroup data drop disk data2;

Diskgroup altered.

GROUP_NUMBER GROUP_NAME NAME                 PATH                 STATE      TOTAL_MB
------------ ---------- -------------------- -------------------- -------- ----------
           0 DATA       DATA2                /dev/raw/raw6        DROPPING       8192
           5 FRA        FRA                  /dev/raw/raw5        NORMAL         8192
           0 DATA       DATA                 /dev/raw/raw4        NORMAL         8192
           0 CRS        CRS_0002             /dev/raw/raw3        NORMAL         3072
           0 CRS        CRS_0001             /dev/raw/raw2        NORMAL         3072
           0 CRS        CRS_0000             /dev/raw/raw1        NORMAL         3072

3.等了一会

GROUP_NUMBER GROUP_NAME NAME                 PATH                 STATE      TOTAL_MB
------------ ---------- -------------------- -------------------- -------- ----------
           5 FRA        FRA                  /dev/raw/raw5        NORMAL         8192
           0 DATA       DATA                 /dev/raw/raw4        NORMAL         8192
           0 CRS        CRS_0002             /dev/raw/raw3        NORMAL         3072
           0 CRS        CRS_0001             /dev/raw/raw2        NORMAL         3072
           0 CRS        CRS_0000             /dev/raw/raw1        NORMAL         3072

注:如果在dropping状态中,忽然反悔了,那么
alter diskgroup data undrop disks;
如果删完了,那就add吧。

你可能感兴趣的:(为data磁盘组删除其中一个盘)