Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2758446
  • 博文数量: 389
  • 博客积分: 4177
  • 博客等级: 上校
  • 技术积分: 4773
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-16 23:29
文章分类

全部博文(389)

分类: Oracle

2013-08-04 20:08:19

                                          使用RMAN多通道进行压缩优化

      在很多时候我们需要对备份进行压缩,如果我们能分配多个通道,那么每个通道对应的服务器进程可以分别在多个CPU上执行
从而达到一个很好的并行,但是分配多个并行通道时需要注意在读取或写出块的时候对io的影响,所以尽量使用rate 来对io进行限
定,例


run
{
allocate channel c1 device type disk rate 200M;
backup as  compressed backupset database format '/bak/test/%U';
release channel c1;
}

 

channel c1: starting piece 1 at 04-AUG-13
channel c1: finished piece 1 at 04-AUG-13
piece handle=/u01/app/oracle/product/11.1.7/db_1/dbs/02ogdt0m_1_1 tag=TAG20130804T030806 comment=NONE
channel c1: backup set complete, elapsed time: 00:55:26


load average: 1.12, 1.08, 0.74
很容易发现这个备份过程主要在compress阶段花费的时间是最长的,因为只有一个通道在运行,所以就算有服务器有再多的cpu,其他的都是处
于空闲状态,只能是一个通道把一个cpu跑满.在一个32cpu的服务器上,负载一直在1多一点,证明只有一个cpu在跑.多cpu的处理能力没有发挥出来.


通过分配多个通道,总的io还是原来的大小,限定的主要原因是防止多个通道把io能力都吃掉.这样可以把通道进程分配在多个cpu上运行,
从而使压缩的过程快速完成

run
{
allocate channel c1 device type disk rate 20M;
allocate channel c2 device type disk rate 20M;
allocate channel c3 device type disk rate 20M;
allocate channel c4 device type disk rate 20M;
allocate channel c5 device type disk rate 20M;
allocate channel c6 device type disk rate 20M;
allocate channel c7 device type disk rate 20M;
allocate channel c8 device type disk rate 20M;
allocate channel c9 device type disk rate 20M;
allocate channel c10 device type disk rate 20M;
backup as  compressed backupset database;
release channel c1;
release channel c2;
release channel c3;
release channel c4;
release channel c5;
release channel c6;
release channel c7;
release channel c8;
release channel c9;
release channel c10;
}


piece handle=/u01/app/oracle/product/11.1.7/db_1/dbs/04oge0an_1_1 tag=TAG20130804T040438 comment=NONE
channel c1: backup set complete, elapsed time: 00:25:57
channel c1: throttle time: 0:00:02
Finished backup at 04-AUG-13


 load average: 4.90, 5.34, 3.37

可以看到最长的完成花费时间是25:57.主机负载也上来了。由于没有指定哪个通道备份哪些文件,有时候可能会还存在一
些不平衡,通过指定某个通道备份哪些文件可以达到更好的平衡.

阅读(5819) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~