// Oracle error reference

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
Error message
maximum open cursors exceeded

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 ResultSet and Statement objects, 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

  1. 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;
  2. Close statements and result sets in finally blocks or with try-with-resources in Java, and close cursors in PL/SQL loops.

  3. 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

The code and message text are from the Oracle Database Error Help. Browse the full Oracle error list or search every database error.

// fewer errors, faster fixes

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.