ORA-00020: Maximum Number of Processes Exceeded – Complete Oracle DBA Troubleshooting & Resolution Guide
ORA-00020: Maximum Number of Processes Exceeded – Complete Oracle DBA Troubleshooting & Resolution Guide
🚨 Quick Production Summary
Error: ORA-00020: maximum number of processes (string) exceeded
Immediate Causes: Exhaustion of the database PROCESSES initialization parameter, runaway connection pooling in middleware layers, connection leaks from unclosed application sessions, or operating system process limit restrictions.
The ORA-00020: maximum number of processes exceeded error is one of the most critical and disruptive alerts an Oracle Database Administrator can encounter. When this error triggers, the database refuses to accept any new connections—including administrative logins via
SQL*Plus AS SYSDBA in certain severe resource-exhaustion scenarios—leaving applications offline and users locked out.
Unlike intermittent query timeouts or network glitches, ORA-00020 is a hard architectural boundary. Every connection to an Oracle Database—whether it is a user session, an application server connection pool, a background background process (like PMON, SMON, DBWn, or LCK0), or an auxiliary parallel query slave—consumes an operating process slot governed by the initialization parameter PROCESSES.
This comprehensive, production-grade guide explores why ORA-00020 occurs, how the Oracle process architecture manages memory and sessions, step-by-step diagnostic workflows, permanent solutions, and preventive monitoring best practices for Oracle Database 11g, 12c, 18c, 19c, 21c, and Oracle Database 23ai.
Typical Error Message & Symptoms
ORA-00020: maximum number of processes (300) exceeded
ORA-20 != 0 - error during process initialization
In enterprise production environments, this error manifests through specific behavioral symptoms:
- Application error logs report sudden database connection failures (e.g.,
java.sql.SQLException: ORA-00020or JDBC pool exhaustion warnings). - New users attempting to log in receive immediate rejection before authentication even occurs.
- Database monitoring tools (such as Oracle Enterprise Manager or custom scripts) fail to poll instance metrics.
- DBAs attempting to connect locally via
sqlplus / as sysdbamay encounter connection hangs or secondary errors likeORA-12510: TNS:listener could not process any available servicesif the operating system process limit or semaphore ceiling has been breached.
Understanding Oracle Process Architecture
To understand why ORA-00020 happens, you must distinguish between Processes and Sessions:
- Processes (`PROCESSES`): The total number of operating system processes that can simultaneously connect to the Oracle instance. This includes background processes spawned automatically by Oracle upon startup plus all dedicated/shared server processes handling user and application connections.
- Sessions (`SESSIONS`): The total number of active user and system sessions allowed concurrently. Oracle calculates a default ceiling for sessions based on processes using the formula:
SESSIONS = (1.5 * PROCESSES) + 22.
When an application opens a connection to the database, it consumes one process slot (in dedicated server architecture) and one session slot. If your peak workload outgrows the configured PROCESSES parameter ceiling, Oracle slams the door on all incoming requests.
Core Root Causes in Production Environments
1. Undersized `PROCESSES` Parameter
The default value of PROCESSES in standard Oracle installations is often relatively low (e.g., 300). Modern enterprise applications—especially those utilizing multi-threaded Java application servers, connection pools, and batch processing agents—routinely exceed this limit during peak hours.
2. Application Connection Leaks
A connection leak occurs when an application opens a database connection (e.g., via JDBC, ODBC, or OCI) to execute transactions or queries but fails to close or return the connection back to the pool. Over time, zombie sessions accumulate until every available process slot is occupied.
3. Misconfigured Connection Pool Max Sizes
If multiple application servers (Tomcat, WebLogic, WildFly, or Spring Boot) connect to a single Oracle database without coordinated limits, their cumulative maximum pool sizes can easily surpass the database's PROCESSES threshold.
4. Runaway Parallel Query Execution
Oracle Parallel DML and DDL operations spawn multiple auxiliary slave processes to accelerate large table scans or index rebuilds. If a poorly written query triggers excessive parallelism across multiple concurrent user sessions, process slots vanish rapidly.
Step-by-Step Troubleshooting Workflow
Step 1 – Connect as SYSDBA and Check Current Parameter Settings
If new logins are blocked, you may still be able to connect locally from the database server host using operating system authentication:
sqlplus / as sysdba
Once connected, query the current setting and utilization of the PROCESSES parameter:
SELECT
RESOURCE_NAME,
CURRENT_UTILIZATION,
MAX_UTILIZATION,
INITIAL_ALLOCATION,
LIMIT_VALUE
FROM V$RESOURCE_LIMIT
WHERE RESOURCE_NAME IN ('processes', 'sessions');
Step 2 – Identify Which Users or Applications Are Consuming Processes
Run the following diagnostic SQL query to inspect active processes grouped by program, machine, or username:
SELECT
NVL(s.username, 'BACKGROUND') AS username,
s.status,
s.machine,
s.program,
COUNT(*) AS process_count
FROM v$session s
GROUP BY s.username, s.status, s.machine, s.program
ORDER BY process_count DESC;
Step 3 – Terminate Abandoned or Leaked Sessions (Emergency Relief)
If specific inactive or orphaned application sessions are clogging your process table, you can terminate them immediately to restore service without restarting the database:
-- Generate kill commands for inactive sessions from a specific host
SELECT 'ALTER SYSTEM KILL SESSION ''' || s.sid || ',' || s.serial# || ''' IMMEDIATE;'
FROM v$session s
WHERE s.status = 'INACTIVE'
AND s.username = 'APP_USER';
Copy and execute the generated ALTER SYSTEM KILL SESSION commands in your SQL*Plus window.
Step 4 – Permanently Increase the `PROCESSES` Parameter
To prevent ORA-00020 from recurring, increase the PROCESSES parameter to a value that comfortably accommodates your peak enterprise workload (e.g., 1000 or higher, depending on your system RAM and CPU core counts).
-- Modify PROCESSES and corresponding SESSIONS scope to SPFILE
ALTER SYSTEM SET processes = 1000 SCOPE = SPFILE;
ALTER SYSTEM SET sessions = 1522 SCOPE = SPFILE;
Note: Changing PROCESSES requires a database restart to take effect:
SHUTDOWN IMMEDIATE;
STARTUP;
Step 5 – Verify Operating System Kernel Limits (Linux)
Increasing Oracle's PROCESSES parameter requires ensuring your Linux operating system kernel can handle the increased process and semaphore allocations. Check your OS limits:
# Check current user process limits for the oracle user
ulimit -u
ulimit -n
Ensure `/etc/security/limits.conf` has appropriate settings for the `oracle` user:
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft nofile 65536
oracle hard nofile 65536
Real Production Case Study
An enterprise Oracle 19c database supporting a high-volume e-commerce platform experienced a complete outage at 9:00 AM on a Monday morning. Users received connection timeouts, and application error logs flooded with ORA-00020: maximum number of processes (300) exceeded.
The DBA logged in locally via sqlplus / as sysdba and queried V$RESOURCE_LIMIT, discovering that MAX_UTILIZATION had hit 300 exactly. Running V$SESSION diagnostics revealed that a newly deployed microservice in the application layer had a misconfigured connection pool, opening thousands of unreleased connections every minute without closing them.
Resolution: The DBA terminated the runaway sessions, temporarily increased PROCESSES to 1000 in the SPFILE, scheduled a rolling database restart during a low-traffic window, and collaborated with the application development team to fix the connection leak in the microservice connection pool.
Frequently Asked Questions (FAQ)
Does increasing PROCESSES consume more server RAM?
Yes. Each Oracle process consumes memory in the Program Global Area (PGA). Increasing PROCESSES from 300 to 1000 means the server must reserve enough RAM to support potential peak PGA allocations across all active processes. Ensure your server has sufficient physical memory before raising this parameter significantly.
What is the formula connecting PROCESSES and SESSIONS?
Oracle automatically sets SESSIONS = (1.5 * PROCESSES) + 22 by default unless you explicitly set the `SESSIONS` parameter yourself in the SPFILE.
Can connection pooling prevent ORA-00020?
Properly configured connection pooling prevents ORA-00020 by reusing existing database connections rather than spawning a new process for every single user request. However, misconfigured pools with excessively high maximum limits or connection leaks can actually accelerate process exhaustion.
About the Author
Rana Abdul Wahid is an Oracle Database Consultant with more than 15 years of professional experience in Oracle Database Administration, Oracle RAC, Oracle Data Guard, RMAN Backup & Recovery, Oracle E-Business Suite, Oracle Cloud Infrastructure (OCI), Performance Tuning, and Linux/Unix system administration.

Comments
Post a Comment