理解ASM(四)条带化原理和rebalance
㈠ 条带化
ASM的条带化有两种:coarse和fine-gained
AU是最小空间分配单元,缺省是1M,每个AU缺省由8个128K条带空间组成。
在coarse条带化中,一个磁盘对应一个AU
所以该条带化适合连续的I/O读写,比如全表扫描表
在fine-gained条带化里,一个AU中的8个128K条带空间,平均打散在磁盘上
也就是说,4个磁盘,1个AU是平均分布在4个磁盘,每个磁盘2个128K
适合于对数据读写延迟比较敏感的文件。如redo日志,控制文件,spfile等
㈡ 重平衡
从diskgroup中添加或删除disk时候,将触发RBAL进程创建rebalance计划、计算时间开销
而后、发消息给ARBn进程(ASM Reblance)处理该请求
ARBn进程对每个extents进行locked, relocated和unlocked操作,执行过程中可以参考v$asm_operation视图
ARBn进程的数量由参数ASM_POWER_LIMIT决定
COD (Continuting Operation Directory)用于记录rebalances情况
如果rebalance失败,在重启instance时候,将从COD读取记录,重新启动rebalance
注意事项:
① rebalance仅仅在diskgroup发生改变时候才进行的,并不是定时执行
如果rebalance执行过程中,server宕机,重启后会自动进行rebalance
② 每个disk的大小必须是相同,如果存在一个小盘,因为rebalance将对每个盘的分配相同比例的空间,可能造成rebalance时候空间不足
如果执行过程中,空闲空间不足,造成rebalance失败,将出现ORA-15041错误,需要再添加disk
如果需要频繁添加disk,每一次都可能造成数据的频繁移动,为提高效率,最好批量添加
注释:
ASM发挥条带化作用的前提是主机里有多块磁盘(不是(一个磁盘里的)多个磁盘分区哦)
ASM的条带化有两种:coarse和fine-gained
AU是最小空间分配单元,缺省是1M,每个AU缺省由8个128K条带空间组成。
在coarse条带化中,一个磁盘对应一个AU
所以该条带化适合连续的I/O读写,比如全表扫描表
在fine-gained条带化里,一个AU中的8个128K条带空间,平均打散在磁盘上
也就是说,4个磁盘,1个AU是平均分布在4个磁盘,每个磁盘2个128K
适合于对数据读写延迟比较敏感的文件。如redo日志,控制文件,spfile等
㈡ 重平衡
从diskgroup中添加或删除disk时候,将触发RBAL进程创建rebalance计划、计算时间开销
而后、发消息给ARBn进程(ASM Reblance)处理该请求
ARBn进程对每个extents进行locked, relocated和unlocked操作,执行过程中可以参考v$asm_operation视图
ARBn进程的数量由参数ASM_POWER_LIMIT决定
COD (Continuting Operation Directory)用于记录rebalances情况
如果rebalance失败,在重启instance时候,将从COD读取记录,重新启动rebalance
注意事项:
① rebalance仅仅在diskgroup发生改变时候才进行的,并不是定时执行
如果rebalance执行过程中,server宕机,重启后会自动进行rebalance
② 每个disk的大小必须是相同,如果存在一个小盘,因为rebalance将对每个盘的分配相同比例的空间,可能造成rebalance时候空间不足
如果执行过程中,空闲空间不足,造成rebalance失败,将出现ORA-15041错误,需要再添加disk
如果需要频繁添加disk,每一次都可能造成数据的频繁移动,为提高效率,最好批量添加
如果磁盘大小一样,仍然没有进行rebalance,需要查看asm_power_limit
OCP题库有道题:
- 16. Immediately after adding a new disk to or removing an existing disk from an Automatic Storage Management (ASM) instance,
- you find that the performance of the database decreases initially, until the addition or removal process is completed.
- Performance then gradually returns to normal levels.
- Which two activities could you perform to maintain a consistent performance of the database while adding or removing disks? (Choose two.)
- A. increase the number of checkpoint processes
- B. define the POWER option while adding or removing the disks
- C. increase the number of DBWR processes by setting up a higher value for DB_WRITER_PROCESSES
- D. increase the number of slave database writer processes by setting up a higher value for DBWR_IO_SLAVES
- E. increase the number of ASM Rebalance processes by setting upa higher value for ASM_POWER_LIMIT during the disk addition or removal
- Answer: B, E
注释:
ASM发挥条带化作用的前提是主机里有多块磁盘(不是(一个磁盘里的)多个磁盘分区哦)
参见:
oracle asm 条带化 谷歌