Home > Database > Mysql Tutorial > body text

ORA-04031错误的解决思路

WBOY
Release: 2016-06-07 17:17:37
Original
1330 people have browsed it

ORA-04031错误的解决思路,使用ASMM的情况下04031问题很少,但有些应用不合理也会导致内存耗尽.1.没有使用绑定变量,导致解析资源占

使用ASMM的情况下04031问题很少,但有些应用不合理也会导致内存耗尽.
1.没有使用绑定变量,导致解析资源占用太多
2.打开过多的cursor不释放
3.bug

第一种.
 使用绑定变量
 使用cursor_sharing参数
第二种.
 查找哪个会话打开的游标比较多
 
 SQL> select sid,count(*) from v$open_cursor group by sid order by 2 desc;

 SID   COUNT(*)
----------- ----------
 148     39
 157     25
 149     22
 147     19
 161     16
 154     15
 162      7
 156      7
 152      2
 150      2
 151      1

11 rows selected.

Elapsed: 00:00:00.01
SQL> select SID,USER_NAME,sql_text from v$open_cursor where sid in (148,157);

找出打开游标多的SID执行的什么SQL,再根据业务判断代码位置.去修改代码

第三种
打补丁

linux

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!