ORA-04031: unable to allocate 32 bytes of shared memory ("shared pool","insert into AppLog nolo...","sql area","kglhin: temp")

tyfun 2008-08-06 09:00:15
ORA-04031: unable to allocate 32 bytes of shared memory ("shared pool","insert into AppLog nolo...","sql area","kglhin: temp")
什么问题呢?????
郁闷得很呢
JAVA代码和SQL又没问题
...全文
1772 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
qq747582024 2012-03-13
  • 打赏
  • 举报
回复
lz解决了不公布结果,无德啊
lineshow 2010-09-02
  • 打赏
  • 举报
回复
tyfun 怎么解决的呢?
tyfun 2008-08-07
  • 打赏
  • 举报
回复
已经解决了
呵呵
tyfun 2008-08-06
  • 打赏
  • 举报
回复
STATISTIC# NAME CLASS VALUE STAT_ID
---------- ---------------------------------------------------------------- ---------- ---------- ----------
3 opened cursors current 1 65 2301954928
tyfun 2008-08-06
  • 打赏
  • 举报
回复
SQL> select count(*) from v$open_cursor ;

COUNT(*)
----------
350



SQL> select * from v$sysstat
2 where name = 'opened cursors current';

STATISTIC# NAME
---------- --------------------------------------------------------
CLASS VALUE STAT_ID
---------- ---------- ----------
3 opened cursors current
1 67 2301954928
cuilike 2008-08-06
  • 打赏
  • 举报
回复
http://tech.ccidnet.com/art/1107/20080401/1406821_1.html
cuilike 2008-08-06
  • 打赏
  • 举报
回复
具体原因及解决方法:

ORA-04031出现的问题有以下几个可能性:

1. 没有绑定编量造成shared_pool碎片过多,同时shared_pool_size太小


(1)这个情况是比较常见的。

(2)第二种情况通常会建议使用绑定变量,或者用简单的加大shared_pool,临时的解决方法就是alter system flush shared_pool。


2. Large_pool,Java_pool太小造成的


(1)这个通过错误信息的提示很容易判断(Ora-04031 cannot allocate .. memeory in [large_pool])

(2)解决方法就是简单的加大 Large_pool or Java_pool


3. 过度的开CURSOR而不关闭。


目前,此问题发生的越来越多,特别是在JAVA的运行环境中,屡见不鲜。加大Shared_pool或者flush shared_pool往往只能延迟问题出现的时间,而无法避免此问题。

判断方法:


select count(*) from v$open_cursor ;
select * from v$sysstat
where name = 'opened cursors current';


假如出来的值特大(以万为单位)时,基本就可以确定是这个原因了。

解决这个问题的方法就是检查程序,看是否没有正常的关闭cursor(对于JAVA来说,就是没有关闭Statement)。或者select sql_text from v$open_cursor,看看都是哪些cursor没关闭,再去检查车程序。

也有的程序使用了保持一定量的cursor一直open,从而避免cursor过多次的开启,来提高性能。对于这种情况,则应该选择适当的shared_pool_size和控制keep_opening的cursor的量。

另外,Oracle参数session_cached_cursors也有可能过大,解决的方法就是把它降低到适当的值。
sgdb 2008-08-06
  • 打赏
  • 举报
回复
oracle 的问题吧,找你们的dba,大概是需要调整shared pool的大小
ming4068 2008-08-06
  • 打赏
  • 举报
回复

67,512

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧