龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > 数据库类 > Oracle 技术 >

Oracle性能调整的要点之SGA(1)(2)

时间:2011-04-12 23:18来源:未知 作者:admin 点击:
分享到:
二、Buffer Cache 1. granule大小的设置,db_cache_size以字节为单位定义了default buffer pool的大小。 如果SGA128M,granule=4M,否则granule=16M,即需要调整sga的时候以gr

二、Buffer Cache

1. granule大小的设置,db_cache_size以字节为单位定义了default buffer pool的大小。

如果SGA<128M,granule=4M,否则granule=16M,即需要调整sga的时候以granule为单位增加大小,并且sga的大小应该是granule的整数倍。

2. 根据v$db_cache_advice调整buffer cache的大小

SELECT size_for_estimate,buffers_for_estimate,estd_physical_read_factor,estd_phy
sical_reads FROM v$db_cache_advice WHERE NAME=’DEFAULT’ AND advice_status=’ON’
AND block_size=(SELECT Value FROM v$parameter WHERE NAME=’db_block_size’); estd_physical_read_factor<=1

3. 统计buffer cache的cache hit ratio>90%,如果低于90%,可以用下列方案解决:

◆ 增加buffer cache的值;

◆ 使用多个buffer pool;

◆ Cache table;

◆ 为sorting and parallel reads 建独立的buffer cache;

SELECT NAME,value FROM v$sysstat WHERE NAME IN (’session logical reads’,'physic
al reads’,'physical reads direct’,'physical reads direct(lob)’); Cache hit ratio=1-(physical reads-physical reads direct-physical reads direct
(lob))/session logical reads; Select 1-(phy.value-dir.value-lob.value)/log.value from v$sysstat log, v$syss
tat phy, v$sysstat dir, v$sysstat LOB where log.name=’session logical reads’ and
phy.name=’physical reads’ and dir.name=’physical reads direct’ and lob.name=’
physical reads direct (lob)’;

影响cache hit ratio的因素:

◆ 全表扫描

◆ 应用设计

◆ 大表的随机访问

◆ cache hits的不均衡分布

4. 表空间使用自动空间管理,消除了自由空间列表的需求,可以减少数据库的竞争

精彩图集

赞助商链接