VOL1
VOL2
VOL3
Connected.
SQL> create diskgroup FAL2 external redundancy disk 'ORCL:VOL3';
Diskgroup created.
SQL> select name,state from v$asm_diskgroup;
NAME STATE
------------------------------ -----------
DATA MOUNTED
FAL2 MOUNTED
FLA MOUNTED
注意:本例中是单节点,添加磁盘组以后ASM会把磁盘组自动mount,如果有其他节点,需要在其他节点手工把磁盘组mount上:alter diskgroup fal2 mount;
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 - Production
With the Partitioning, OLAP and Data Mining options
SQL> col name format a15
SQL> col failgroup format a20
SQL> col path format a30
SQL> select name,failgroup,path from v$asm_disk;
NAME FAILGROUP PATH
--------------- -------------------- ------------------------------
ORCL:VOL4
VOL1 VOL1 ORCL:VOL1
VOL2 VOL2 ORCL:VOL2
VOL3 VOL3 ORCL:VOL3
SQL> select name from v$asm_diskgroup;
NAME
---------------
DATA
FRA
DATA2
SQL> select name,total_mb,free_mb from v$asm_disk;
NAME TOTAL_MB FREE_MB
--------------- ---------- ----------
511 0
VOL1 4094 1872
VOL2 4094 3867
VOL3 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 1872
VOL2 4094 3867
VOL3 511 433
VOL4 511 434
Drop 磁盘操作
SQL> select name,failgroup,path from v$asm_disk;
NAME FAILGROUP PATH
--------------- -------------------- ------------------------------
VOL1 VOL1 ORCL:VOL1
VOL2 VOL2 ORCL:VOL2
VOL3 VOL3 ORCL:VOL3
VOL4 VOL4 ORCL:VOL4
SQL> 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:VOL1
VOL2 VOL2 ORCL:VOL2
VOL3 VOL3 ORCL:VOL3
VOL4 VOL4 ORCL:VOL4
SQL> select name,total_mb,free_mb from v$asm_disk;
NAME TOTAL_MB FREE_MB
--------------- ---------- ----------
511 0
VOL1 4094 1872
VOL2 4094 3867
VOL3 511 358
SQL> select name,failgroup,path from v$asm_disk;
NAME FAILGROUP PATH
--------------- -------------------- ------------------------------
ORCL:VOL4
VOL1 VOL1 ORCL:VOL1
VOL2 VOL2 ORCL:VOL2
VOL3 VOL3 ORCL:VOL3
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Ora10gASM-> ps -ef | grep rbal
oracle 5291 1 0 19:30 ? 00:00:03 asm_rbal_+ASM
oracle 5469 1 0 19:44 ? 00:00:01 ora_rbal_benbo
oracle 5970 4700 0 20:25 pts/1 00:00:00 grep rbal
Ora10gASM->
NAME
--------------------------------------------------------------------------------
+DATA/orcl/datafile/system.260.675705525
+DATA/orcl/datafile/undotbs1.264.675705527
+DATA/orcl/datafile/sysaux.265.675705527
+DATA/orcl/datafile/users.263.675705527
+FAL2/orcl/datafile/hxre.277.675956263
比如,我们把+FAL2/orcl/datafile/hxre.277.675956263迁移到+DATA磁盘组中
sql statement: alter database datafile 5 offline
RMAN> run
2> {
3> copy datafile 5 to '+DATA';
4> }
通过asmcmd查看一下在+DATA中数据文件的名称,然后用rman switch datafile
2> {
3> switch datafile 5 to datafilecopy '+DATA/ORCL/DATAFILE/HXRE.266.676029249';
4> }
RMAN>recover datafile 5;
ORA-29701 :unable to connect to Cluster Manager 的处理方法:
localconfig add
--------------------