oracle SGA的查询与调整 三

其他SGA对象
redo log buffer
对应的参数是log_buffer,缺省值与 OS相关,一般是500K。检查v$session_wait中是否存在log buffer wait,v$sysstat中是否存在redo buffer allocation retries
A、检查是否存在log buffer wait:
select * from v$session_wait where event='log buffer wait';
如果出现等待,一是可以增加log buffer的大小,也可以通过将log 文件移到访问速度更快的磁盘来解决。
B、select name,value from v$sysstat where name in('redo buffer allocation retries','redo entries');
Redo buffer allocation retries接近0,小于redo entries 的1%,如果一直在增长,表明进程已经不得不等待redo buffer的空间。如果Redo buffer allocation retries过大,增加log_buffer的值。
C、检查日志文件上是否存在磁盘IO竞争现象
select event,total_waits,time_waited,average_wait from v$system_event where event like 'log file switch completion%';
如果存在竞争,可以考虑将log文件转移到独立的、更快的存储设备上或增大log文件。
D、检查点的设置是否合理
检查alert.log文件中,是否存在‘checkpoint not complete’;
select event,total_waits,time_waited,average_wait from v$system_event where event like 'log file switch%';
如果存在等待,调整log_checkpoint_interval、log_checkpoint_timeout的设置。
E、检查log archiver的工作
select event,total_waits,time_waited,average_wait from v$system_event where event like ‘log file switch (arch%’;
如果存在等待,检查保存归档日志的存储设备是否已满,增加日志文件组,调整log_archive_max_processes。
F、DB_block_checksum=true,因此增加了性能负担。(为了保证数据的一致性,oracle的写数据的时候加一个checksum在block上,在读数据的时候对checksum进行验证)
在设置日志缓冲区时,可以参考下面这个建议的公式来计算:1.5×(平均每个事务所产生的重做记录大小×每秒提交的事务数量)。
首先先找到总事务量是多少:
select a.value as trancount 
from v$sysstat a,v$statname b
where a.statistic# = b.statistic# and b.name = 'user commits';
然后,找到系统总共的运行时间: 
select trunc(sysdate - startup_time)*24*60*60 as seconds from v$instance;
第三,找到所产生的所有重做记录大小: select value as redoblocks from v$sysstat where name = 'redo blocks written';
最后,我们可以分别计算公式中的值:平均每个事务所产生的重做记录大小= redoblocks/trancount;每秒提交的事务数量=trancount/seconds。这样,最后所建议的日志缓冲区的大小可以写为: 
1.5* (redoblocks/trancount)* (trancount/seconds)
java pool
对于大的应用,java_pool_size应>=50M,对于一般的java存储过程,缺省的20M已经够用了。
检查是否需要调整DBWn  (按CPU的个数来调整db_writer_processes)
select total_waits from v$system_event where event=’free buffer waits’;

你可能感兴趣的:(oracle,SGA,调整)