ora-04301故障處理

arthurtangel發表於2011-09-19
上一次資料庫報ora-04301,調整了一下shared pool size ,好過一段時間,最近又發生了這個錯誤。所以決心好好整一下應用,主要還是碎片太嚴重啊。

先看看網友們的一些總結,分析:

筆記[理解與調整共享池]
http://ms.itpub.net/redirect.php?fid=2&tid=1068873&goto=nextnewset

使用shell指令碼監控共享池記憶體碎片
http://www.itpub.net/thread-1072958-1-1.html

Oracle資料庫效能優化實務 共享池分析
http://wenku.baidu.com/view/412e8d47b307e87101f69614.html

例項故障分析
http://informix.blog.163.com/blog/static/9508027120099200465266/

Oracle 檢視 Shared Pool 資訊的相關指令碼
http://blog.csdn.net/tianlesoftware/article/details/6622318

深入記憶體元件shared pool--之ORA-04031錯誤
http://blog.csdn.net/inthirties/article/details/4822268

eygle的shared pool分析
http://www.eygle.com/archives/2004/10/shared_pool-1.html

---------------------------------------------------------------------------------------

select ksmchidx,
       (case
         when ksmchsiz >= 65560 then
          254
         when ksmchsiz >= 32792 then
          253
         when ksmchsiz >= 40 then
          1
         when ksmchsiz >= 32 then
          0
       end) bucket#,
       count(*) free_chunks,
       sum(ksmchsiz) free_space,
       trunc(avg(ksmchsiz)) avg_chunk_size
  from x$ksmsp
where ksmchcls = 'free'
group by ksmchidx,
       (case
         when ksmchsiz >= 65560 then
          254
         when ksmchsiz >= 32792 then
          253
         when ksmchsiz >= 40 then
          1
         when ksmchsiz >= 32 then
          0
       end);

這個是觀察shared pool碎片情況的SQL

select name,value from v$sysstat where name like '%parse%';

檢視解析情況,好多的硬解析,和軟解析差不了!

    
       
SELECT substr(sql_text, 1, 40) "SQL", count(*), sum(executions) "TotExecs",max(sql_id) sql_id
  FROM v$sqlarea
WHERE executions < 5
GROUP BY substr(sql_text, 1, 40)
HAVING count(*) > 30
ORDER BY 2;

  select *  FROM v$sqlarea where sql_id='g2b789ppwxjx8';   

查佔用shared pool較多的sql。

ELECT KSMCHCLS CLASS, COUNT(KSMCHCLS) NUM, SUM(KSMCHSIZ) SIZ, 
   To_char( ((SUM(KSMCHSIZ)/COUNT(KSMCHCLS)/1024)),'999,999.00')||'k' "AVG SIZE" 
   FROM X$KSMSP GROUP BY KSMCHCLS; 

shared pool 情況。

故障分析
http://space.itpub.net/14075938/viewspace-474727


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/11990065/viewspace-707887/,如需轉載,請註明出處,否則將追究法律責任。

相關文章