為data磁盤組刪除其中一個盤(asmexternaldata盤組中有兩塊盤)
刪除磁盤,注意,如果刪掉磁盤之後,數據在剩余磁盤中,是否有足夠空間存儲。如果空間不夠,刪除工作不會成功。
檢查空間夠不夠:
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吧。