报这个错误时因为磁盘设备头文件还存储了之前磁盘组的信息,因此需要清楚头部的信息。
dd if=/dev/zero of='/dev/asm_dell' bs=1M count=200
[root@asmstudy ~]# dd if=/dev/zero of=/dev/asm-diskb bs=1M count=200
200+0 records in
200+0 records out
209715200 bytes (210 MB) copied, 5.86341 s, 35.8 MB/s
然后再次执行上面的命令增加磁盘到磁盘组datadg中,并等待其平衡数据到新的磁盘中
或者说这样,不用DD也行。
然后再执行:
alter diskgroup wdfdata add disk '/dev/asm_dell' name WDFDATA_0002 rebalance power 1 wait;
建议这样,方便直接查询同步信息,加了wait需要一直到完成执行才会跑完
alter diskgroup wdfdata add disk '/dev/asm_dell' name WDFDATA_0002 rebalance power 1;
再查询:
select * from v$asm_operation;
设置磁盘组的兼容性版本为11.2.0.0.0,才可以支持镜像快速恢复,否则每次磁盘脱离后都会全量恢复。
alter diskgroup wdfdata set attribute 'compatible.rdbms'='11.2.0.0.0';
官方文档:
If the attribute is not set explicitly, then the default value (3.6h
) applies to disks that have been set to OFFLINE
mode without an explicit DROP
AFTER
clause. Disks taken offline due to I/O errors do not have a DROP
AFTER
clause.
如果未显式设置属性,则默认值(3.6h)适用于未设置显式DROP AFTER子句的已设置为OFFLINE模式的磁盘。由于I / O错误而脱机的磁盘没有DROP AFTER子句。
You can use ALTER
DISKGROUP
to set the DISK_REPAIR_TIME
attribute to a specified hour or minute value, such as 4.5 hours or 270 minutes. For example:
您可以使用ALTER DISKGROUP将DISK_REPAIR_TIME属性设置为指定的小时或分钟值,例如4.5小时或270分钟。例如
ALTER DISKGROUP data SET ATTRIBUTE 'disk_repair_time' = '4.5h' ALTER DISKGROUP data SET ATTRIBUTE 'disk_repair_time' = '270m'
If an offline disk is taken offline for a second time, then the elapsed time is reset and restarted. If another time is specified with the DROP
AFTER
clause for this disk, the first value is overridden and the new value applies. A disk that is in OFFLINE
mode cannot be dropped with an ALTER
DISKGROUP
DROP
DISK
statement; an error is returned if attempted. If for some reason the disk must be dropped (such as the disk cannot be repaired) before the repair time has expired, a disk can be dropped immediately by issuing a second OFFLINE
statement with a DROP
AFTER
clause specifying 0h
or 0m
.
如果脱机磁盘第二次脱机,则重置并重新启动已用时间。如果DROP
AFTER
为此磁盘的子句指定了另一个时间,则将覆盖第一个值,并应用新值。处于OFFLINE
模式的磁盘不能使用ALTER
DISKGROUP
DROP
DISK
语句删除; 如果尝试,则返回错误。如果由于某种原因磁盘必须在修复时间到期之前被丢弃(例如磁盘无法修复),则可以通过发出OFFLINE
带有DROP
AFTER
指定0h
或的子句的第二个语句立即删除磁盘0m
。
如:
ALTER DISKGROUP data OFFLINE DISK DATA_001 DROP AFTER 5m;
要删除磁盘组下的磁盘:
The following example takes disk DATA_001
offline and drops it after five minutes.
将disk DATA_001 设置为offline状态,并在5分钟后删除
ALTER DISKGROUP data OFFLINE DISK DATA_001 DROP AFTER 5m;
The next example takes the disk DATA_001
offline and drops it after the time period designated by DISK_REPAIR_TIME
elapses:
将disk DATA_001从磁盘组中offline,然后如果在DISK_REPAIR_TIME
指定的时间内未进行online操作后,系统会在超过这个时间后自动将其drop掉
ALTER DISKGROUP data OFFLINE DISK DATA_001;
This example takes all of the disk in failure group FG2
offline and drops them after the time period designated by DISK_REPAIR_TIME
elapses. IF you used a DROP
AFTER
clause, then the disks would be dropped after the specified time:
此示例使故障组FG2中的所有磁盘脱机,并在经过DISK_REPAIR_TIME指定的时间段后将其删除。如果使用DROP AFTER子句,则磁盘将在指定时间后丢弃:
ALTER DISKGROUP data OFFLINE DISK IN FAILGROUP FG2;
The next example brings all of the disks in failure group FG2
online:
下一个示例使故障组FG2中的所有磁盘联机:
ALTER DISKGROUP data ONLINE DISK IN FAILGROUP FG2;
This example brings only disk DATA_001
online:
此示例仅使磁盘DATA_001在线
ALTER DISKGROUP data ONLINE DISK DATA_001;
This example brings all of the disks in disk group DATA
online:
此示例使磁盘组DATA中的所有磁盘联机:
ALTER DISKGROUP data ONLINE ALL;
Querying the V$ASM_OPERATION
view while you run any of these types of ALTER
DISKGROUP
... ONLINE
statements displays the name and state of the current operation that you are performing. For example, the query:
在运行以下任何类型的ALTER DISKGROUP ... ONLINE语句时,查询V $ ASM_OPERATION视图将显示您正在执行的当前操作的名称和状态。例如,查询:
SELECT GROUP_NUMBER, OPERATION, STATE FROM V$ASM_OPERATION;
Displays output similar to the following:
GROUP_NUMBER OPERA STAT ------------ ----- ---- 1 ONLIN RUN
An OFFLINE
operation is not displayed in a V$ASM_OPERATION
view query.
select sofar,est_work,est_rate,est_minutes from v$asm_operation