内存优化(查询各子内存模块的命中率)

本文提供了一系列Oracle数据库性能调优的方法,包括数据缓冲区命中率、共享池命中率、SQL及PL/SQL内存命中率等关键指标的监测与优化策略。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

instance= memory + background process

memory= sga +pga

sga=shared_pool + db_buffer_cache+log_buffer

shared_pool=libary_cache+dictionary_cache

---A 数据缓冲区的命中率--- should be more than 90%

select 1 - 
         sum(case when name like '%physical reads%' then value else 0 end) /
       (sum(case when name like  '%db block gets%' then value else 0 end ) +
       sum(case when name like '%consistent gets%' then value else 0 end))
        as hit_ratio
  from v$sysstat;


---B 共享池命中率---should be more than 60%

select s.used,p.VALUE sharedpool_usage_ratio  from (select sum(bytes) used from v$sgastat where pool ='shared pool' and name <>'free memory') s,v$parameter p where p.NAME='shared_pool_size';


-----------------1、sql,pl/sql内存命中率,library cache库缓存命中率)

select ((sum(pinhits)/sum(pins))) pinhitratio,sum(reloads) misses ,((sum(pins)/(sum(pins)+sum(reloads)))) relhitratio from v$librarycache


-----------------2、dictionary cache命中率(95%-99%)

select (sum(gets - getmisses -fixed))/sum(gets) "data dictionary hit ratio" from v$rowcache;


---C pga命中率
-----------------1、workarea_size_policy=auto

select * from v$pgastat where name like 'cache hit percentage';


-----------------2、workarea_size_policy=manul

select name,value from V$sysstat where name like '%sort%';
select * From v$sga;
select * from v$sgainfo;
select * from v$sga_dynamic_components;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值