2.重新加入CELL01的盘
由于时间超过默认的3.6h,offline的盘已经被删除,只有重新加入CELL01的盘才可以。
alter diskgroup CRS add disk '/dev/CELL01-crs1';
alter diskgroup DATA ADD FAILGROUP CELL01 disk '/dev/CELL01-data1', '/dev/CELL01-data2' rebalance power 5;
直接这样加盘很可能会遇到下面这类错误,因为这些盘之前是被使用过的:
SQL> alter diskgroup CRS add disk '/dev/CELL01-crs1';
alter diskgroup CRS add disk '/dev/CELL01-crs1'
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15033: disk '/dev/CELL01-crs1' belongs to diskgroup "CRS"
这个问题可以通过dd盘头,也可以加盘尝试加force参数来解决,我这里选择dd盘头的方式:
[root@db01 ~]# dd if=/dev/zero of=/dev/CELL01-crs1 bs=8k count=1000
1000+0 records in
1000+0 records out
8192000 bytes (8.2 MB) copied, 0.0691801 s, 118 MB/s
dd盘头之后再次尝试添加就可以顺利完成:
SQL> alter diskgroup CRS add disk '/dev/CELL01-crs1';
Diskgroup altered.
同样的,将CELL01的数据盘也重新加入到DATA磁盘组中,failgroup名称为CELL01:
SQL> alter diskgroup DATA ADD FAILGROUP CELL01 disk '/dev/CELL01-data1', '/dev/CELL01-data2' rebalance power 5;
Diskgroup altered.
通过v$asm_operation视图可以查看磁盘重新平衡的进度,直到下面的查询不再返回结果说明重平衡完成:
SQL> select * from v$asm_operation;
GROUP_NUMBER OPERATION STATE POWER ACTUAL SOFAR EST_WORK EST_RATE EST_MINUTES ERROR_CODE
------------ ---------- -------- ---------- ---------- ---------- ---------- ---------- ----------- --------------------
2 REBAL RUN 5 5 366 529 348 0
SQL> select * from v$asm_operation;
no rows selected
3.修改failgroup的配置
CELL03的数据盘,failgroup目前配置还不正确。
SQL> alter diskgroup DATA drop disk DATA_0000, DATA_0001;
Diskgroup altered.
查询v$asm_operation视图可以查看磁盘重新平衡的进度,完成后再重新加回磁盘组,指定确切的failgroup(CELL03):
SQL> alter diskgroup DATA ADD FAILGROUP CELL03 disk '/dev/CELL03-data1', '/dev/CELL03-data2' rebalance power 5;
Diskgroup altered.
再次关注重平衡进度,最后查询一切正常,结果如下:
SQL> col path for a50
SQL> select group_number, disk_number, name, path, failgroup, mode_status, voting_file from v$asm_disk order by 1, 2;
GROUP_NUMBER DISK_NUMBER NAME PATH FAILGROUP MODE_STATUS VO
------------ ----------- ------------------------------ ----------------------- -------------------- -------------- --
1 0 CRS_0000 /dev/CELL01-crs1 CRS_0000 ONLINE Y
1 1 CRS_0001 /dev/CELL02-crs2 CRS_0001 ONLINE Y
1 2 CRS_0002 /dev/CELL03-crs3 CRS_0002 ONLINE Y
2 0 DATA_0000 /dev/CELL03-data1 CELL03 ONLINE N
2 1 DATA_0001 /dev/CELL03-data2 CELL03 ONLINE N
2 2 DATA_0002 /dev/CELL02-data1 CELL02 ONLINE N
2 3 DATA_0003 /dev/CELL02-data2 CELL02 ONLINE N
2 4 DATA_0004 /dev/CELL01-data1 CELL01 ONLINE N
2 5 DATA_0005 /dev/CELL01-data2 CELL01 ONLINE N
9 rows selected.
SQL> select group_number, name, total_mb, free_mb, USABLE_FILE_MB, offline_disks, state, type from v$asm_diskgroup;