Oracle LibCache等待优化(一)

来源:这里教程网 时间:2026-03-03 22:16:42 作者:

1.   慢SQL导致业务响应失败

2.TOP 10等待与gc,libcache lock/pin相关    3.ADDM硬解析 

4.   TOP等待包括大量后端进程等待

5.   SQL by parse

//TOP数据字典查询

select /* KSXM:LOAD_DML_INF *//*+ leading(o) index(m) use_nl(m) */ nvl(m.inserts, 0) ins, 
nvl(m.updates, 0) upd, nvl(m.deletes, 0) del, nvl(m.drop_segments, 0) dropseg, nvl(m.flags, 0) 
flags, nvl(rowcnt, 0) rowcnt, o.pobjn pobjn from (select :objn objn, 0 pobjn, rowcnt from 
tab$ t where t.obj# = :objn union all select :objn objn, tp.bo# pobjn, rowcnt from tabpart$ 
tp where tp.obj# = :objn union all select :objn objn, tcp.bo# pobjn, rowcnt 
from tabcompart$ tcp where tcp.obj# = :objn union all select :objn objn, tsp.pobj# pobjn, 
rowcnt from tabsubpart$ tsp where tsp.obj# = :objn) o, sys.mon_mods_all$ m 
where o.objn = m.obj#(+) and rownum < 2

6.   Mutex Sleep Summary

7.   Version count700+

8.ASH有lgwr等待

9.优化方法,优化参数

alter system set "_use_single_log_writer"=FALSE sid='*' scope=spfile;
alter system set "_use_adaptive_log_file_sync"=FALSE           sid='*' scope=spfile;
alter system set "_gc_policy_time"=0 sid='*' scope=spfile;
alter system set "_gc_undo_affinity"=FALSE sid='*' scope=spfile;
alter system set "_cursor_obsolete_threshold" =1024           sid='*' scope=spfile;
alter system set "_optimizer_extended_cursor_sharing"='NONE' sid='*';
alter system set "_optimizer_extended_cursor_sharing_rel"='NONE'  sid='*';
alter system set "_optimizer_adaptive_cursor_sharing"=FALSE  sid='*';
alter system set "_optimizer_use_feedback"=false               sid='*';

10.优化效果对比

//解析

//version count

11.调优后TOP等待*(libcache/parse相关已优化)

相关推荐