ORA-01000: maximum open cursors exceeded
A session opened more cursors than OPEN_CURSORS allows, almost always because statements/result sets aren't closed.
ORA-01000: maximum open cursors exceededmaximum open cursors exceeded Oracle JDBCjava.sql.SQLException: ORA-01000OPEN_CURSORS exceeded Meaning
It is nearly always an application leak: close ResultSet, Statement and PreparedStatement (try-with-resources), avoid creating statements in loops without closing, and fix ref cursors. Raise OPEN_CURSORS only after fixing the leak. Check v$open_cursor.
Common causes
- Statements/ResultSets not closed
- Prepared statements created in a loop
- Ref cursors never closed
OPEN_CURSORStoo low- Connection pool caching too many statements
⚡ Quick fix
- Close resources (try-with-resources / finally)
- Find leaks:
SELECT sql_text, COUNT(*) FROM v$open_cursor GROUP BY sql_text ORDER BY 2 DESC - Then raise
OPEN_CURSORS
Detailed fix by platform
SQL
SELECT a.value, s.sid, s.username FROM v$sesstat a, v$statname b, v$session s WHERE a.statistic#=b.statistic# AND s.sid=a.sid AND b.name='opened cursors current' ORDER BY a.value DESC;
How to diagnose
- Open cursors — Growing?
- Close — Missing?
- OPEN_CURSORS — Value?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in SQL
Other ways to find it
Where this error sits
Origin: Data. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 18 Nov 2026