ASM磁盘组支持动态扩展,我们可以向现有的磁盘组动态加入新的磁盘,新磁盘加入后,Oracle通过后台RBAL进行Rebalance,将当前的数据均衡到新增加的磁盘上。Drop磁盘亦会Rebalance。
asm_power_limit参数用于控制Rebalance的速度,取值 1~11,数字越大,平衡速度越快,默认值是1。如果该数字很大,则可能因为Rebalance而影响性能。也可以通过在alter diskgroup .. add/drop disk命令中通过rebalance power [1~11]选项控制Rebalance的速度。
Ora10gASM-> sqlplus "/ as sysdba"
SQL*Plus: Release 10.2.0.1.0 - Production on Wed May 28 20:11:39 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProductionWith the Partitioning, OLAP and Data Mining optionsSQL> col name format a15
SQL> col failgroup format a20SQL> col path format a30SQL> select name,failgroup,path from v$asm_disk;NAME FAILGROUP PATH
--------------- -------------------- ------------------------------ORCL:VOL4VOL1 VOL1 ORCL:VOL1VOL2 VOL2 ORCL:VOL2VOL3 VOL3 ORCL:VOL3SQL> select name from v$asm_diskgroup;
NAME
---------------DATAFRADATA2SQL> select name,total_mb,free_mb from v$asm_disk;
NAME TOTAL_MB FREE_MB
--------------- ---------- ----------511 0VOL1 4094 1872VOL2 4094 3867VOL3 511 358加入磁盘ORCL:VOL4到DATA2磁盘组
SQL> alter diskgroup DATA2 add disk 'ORCL:VOL4' rebalance power 1;
Diskgroup altered.
Rebalance后磁盘空间使用情况
SQL> select name,total_mb,free_mb from v$asm_disk;
NAME TOTAL_MB FREE_MB
--------------- ---------- ----------VOL1 4094 1872VOL2 4094 3867VOL3 511 433VOL4 511 434Drop 磁盘操作
SQL> alter diskgroup DATA2 drop disk 'ORCL:VOL4' rebalance power 11;
alter diskgroup DATA2 drop disk 'ORCL:VOL4' rebalance power 11*ERROR at line 1:ORA-15032: not all alterations performedORA-15054: disk "ORCL:VOL4" does not exist in diskgroup "DATA2" SQL> select name,failgroup,path from v$asm_disk;NAME FAILGROUP PATH
--------------- -------------------- ------------------------------VOL1 VOL1 ORCL:VOL1VOL2 VOL2 ORCL:VOL2VOL3 VOL3 ORCL:VOL3VOL4 VOL4 ORCL:VOL4SQL> alter diskgroup DATA2 drop disk 'VOL4' rebalance power 11;
Diskgroup altered.
SQL> select name,failgroup,path from v$asm_disk;
NAME FAILGROUP PATH
--------------- -------------------- ------------------------------VOL1 VOL1 ORCL:VOL1VOL2 VOL2 ORCL:VOL2VOL3 VOL3 ORCL:VOL3VOL4 VOL4 ORCL:VOL4SQL> select name,total_mb,free_mb from v$asm_disk;
NAME TOTAL_MB FREE_MB
--------------- ---------- ----------511 0VOL1 4094 1872VOL2 4094 3867VOL3 511 358SQL> select name,failgroup,path from v$asm_disk;
NAME FAILGROUP PATH
--------------- -------------------- ------------------------------ORCL:VOL4VOL1 VOL1 ORCL:VOL1VOL2 VOL2 ORCL:VOL2VOL3 VOL3 ORCL:VOL3SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProductionWith the Partitioning, OLAP and Data Mining optionsOra10gASM-> ps -ef | grep rbaloracle 5291 1 0 19:30 ? 00:00:03 asm_rbal_+ASMoracle 5469 1 0 19:44 ? 00:00:01 ora_rbal_benbooracle 5970 4700 0 20:25 pts/1 00:00:00 grep rbalOra10gASM->