Solution to ORA-04031 errors

Source: Internet
Author: User

When ASMM is used, there are few 04031 problems, but some applications may also exhaust the memory.
1. No bound variable is used, resulting in too much resource occupation for parsing.
2. Open too many cursor and do not release
3. bug

First.
Bind Variable
Use the cursor_sharing Parameter
Second.
Find which session has opened more cursors
 
SQL> select sid, count (*) from v $ open_cursor group by sid order by 2 desc;

Sid count (*)
---------------------
148 39
157 25
149 22
19, 147
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 );

Find out the SQL statement that is executed by opening the SID with multiple cursors, and then determine the Code Location Based on the business. modify the code.

Third
Patch

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.