ORA-01000: maximum open cursors exceeded
The session has more cursors open than the OPEN_CURSORS limit, nearly always because application code doesn't close statements or result sets.
- Error code
ORA-01000- Category
- Space, memory and limits
What it means
Each open statement and result set uses a cursor, and OPEN_CURSORS caps how many a session may have open at once. ORA-01000 means the session hit the cap. Raising the limit hides the problem if the application leaks cursors; the real fix is closing them.
Common causes
- JDBC or other driver code that doesn't close
ResultSetandStatementobjects, often in error paths. - Opening a cursor inside a loop without closing it.
- Statement caching configured larger than
OPEN_CURSORS. - A legitimately high number of concurrent cursors with a low limit.
How to fix it
-
See which sessions and SQL hold the most open cursors.
SELECT s.sid, s.username, COUNT(*) AS open_cursors FROM v$open_cursor oc JOIN v$session s ON s.sid = oc.sid GROUP BY s.sid, s.username ORDER BY open_cursors DESC;
-
Close statements and result sets in
finallyblocks or with try-with-resources in Java, and close cursors in PL/SQL loops. -
If the application really needs more, raise the limit.
ALTER SYSTEM SET open_cursors = 1000 SCOPE = BOTH;
Related errors
More space, memory and limits errors
ORA-01652unable to extend temp segmentORA-01653unable to extend table in tablespaceORA-01950no privileges on tablespaceORA-01555snapshot too oldORA-30036unable to extend segment in undo tablespaceORA-04031unable to allocate bytes of shared memoryORA-00257archiver error
The code and message text are from the Oracle Database Error Help. Browse the full Oracle error list or search every database error.
Work on Oracle in SQLly
A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for Oracle and the other databases you use.