dg库日志应用慢参数调整
dg库日志应用慢参数调整
1> 日志应用是否使用了并行;-并行度看主机的cpu个数
1 alter database recover managed standby database parallel 8 disconnect from session;
2> 调整并行恢复参数 parallel_execution_message_size 最大值65536;增加size需要更加多的share pool。
调整参数时,需要确定shared pool的使用情况,避免4031错误
1 show parameter parallel_execution_message_size 2 show parameter disk_asynch_io 3 show parameter parallel_execution_message_size 4 5 alter system set parallel_execution_message_size=32768 scope=spfile; 6 alter system set disk_asynch_io=true scope=spfile;
3> 是否使用异步io;通常异步io能提供更好的io性能;aix hp 貌似默认是开启异步io的
1 alter system set filesystemio_options=setall; 2 show parameter filesystemio_options
4> db_block_checking --块内数据逻辑检查
在dg库上取消该参数,能提供更好的性能,经过测试能提升约2倍速度
1 alter system set db_block_checking=false scope=spfile; 2 3 4 startup nomount; 5 alter database mount standby database; 6 7 -------------------------------------------- 8 9 alter system set parallel_execution_message_size=32768 scope=spfile; 10 alter system set filesystemio_options=setall scope=spfile; 11 alter system set disk_asynch_io=true scope=spfile; 12 alter database recover managed standby database cancel; 13 14 shutdown immediate; 15 startup 16 17 alter database recover managed standby database parallel 4 disconnect from session using current logfile;
极端情况下DG加快恢复速度===在standby端执行,千万不可在primary端调整
1 alter system set parallel_execution_message_size=32768 scope=spfile; 16384 2 alter system set filesystemio_options=setall scope=spfile; 默认 none 3 alter system set disk_asynch_io=true scope=spfile; 默认就是true 4 5 alter system set db_lost_write_protect=typical scope=spfile ; 默认是full 6 7 alter system set db_block_checksum=false scope=spfile ; 默认是TYPICAL 8 9 alter system set DB_BLOCK_CHECKING=false scope=spfile ; 默认是false 10 11 alter system set db_writer_processes=8 scope=spfile; 默认是6个 12 13 shutdown immediate; 14 15 startup nomount; 16 alter database mount standby database; 17 alter database recover managed standby database parallel 4 disconnect from session; ?----并行度根据CPU核数*2设定
另外shared_pool size过小也会影响应用速度,请遇到DG延迟的时候 可适当根据安装规范检查,防止shared pool过小。(如最小要保证2G以上)
dg库日志应用性能监控
1 set lines 200 pages 2000 2 col process format a8 3 col spid format a8 4 col event format a50 tru 5 col SIW format 999999 6 7 select to_char(sysdate,'DD-MON-YYYY HH24:MI:SS') "Current time" 8 ,s.process 9 , p.spid 10 , substr(s.program, -6) PROC 11 , s.event 12 , s.p1 13 , s.p2 14 , s.p3 15 , s.seconds_in_wait SIW 16 , s.seq# 17 from v$session s, v$process p 18 where p.addr = s.paddr and (s.program like '%MRP%' or s.program like '%PR0%' or s.program like '%DBW%' or s.program like '%CKPT%') 19 order by s.process 20 21 /