Home > Database > Mysql Tutorial > oracle中ora-04301故障处理

oracle中ora-04301故障处理

WBOY
Release: 2016-06-07 17:46:17
Original
2189 people have browsed it

本文章来介绍在使用oracle数据库时出现了04301错误的解决方法,有碰到想同问题的同学可以参考一下本文章来处理哦,此文章做笔记使用。

本文章来介绍在使用oracle数据库时出现了04301错误的解决方法,有碰到想同问题的同学可以参考一下本文章来处理哦,此文章做笔记使用。

上一次报ora-04301,调整了一下shared pool size ,好过一段时间,最近又发生了这个错误。所以决心好好整一下应用,主要还是碎片太严重啊。

 代码如下 复制代码


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 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 情况。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template