DEV Community

umzzil nng
umzzil nng

Posted on Originally published at oraerror.com

Oracle ORA-12500 Error: Causes and Solutions Complete Guide

ORA-12500: TNS: Listener Failed to Start a Dedicated Server Process

ORA-12500 occurs when the Oracle Net listener receives a client connection request but cannot spawn a new dedicated server process to handle it. This is a critical connectivity error that prevents new database sessions from being established entirely. It typically signals resource exhaustion at either the Oracle or operating system level.


Top 3 Causes and Fixes

Cause 1: PROCESSES Parameter Limit Reached

The most common cause is hitting the PROCESSES initialization parameter ceiling. When all process slots are occupied, the listener cannot fork new server processes.

-- Check current PROCESSES limit vs. actual usage
SELECT
    RESOURCE_NAME,
    CURRENT_UTILIZATION,
    MAX_UTILIZATION,
    LIMIT_VALUE
FROM V$RESOURCE_LIMIT
WHERE RESOURCE_NAME IN ('processes', 'sessions');

-- Identify and kill long-idle sessions
SELECT SID, SERIAL#, USERNAME, STATUS,
       LAST_CALL_ET AS IDLE_SECONDS,
       MACHINE, PROGRAM
FROM V$SESSION
WHERE STATUS = 'INACTIVE'
  AND LAST_CALL_ET > 1800
ORDER BY LAST_CALL_ET DESC;

-- Kill a zombie session
ALTER SYSTEM KILL SESSION '42,1234' IMMEDIATE;

-- Increase PROCESSES limit (requires DB restart)
ALTER SYSTEM SET PROCESSES = 500 SCOPE = SPFILE;
ALTER SYSTEM SET SESSIONS = 555 SCOPE = SPFILE;
-- Then: SHUTDOWN IMMEDIATE; STARTUP;
Enter fullscreen mode Exit fullscreen mode

Cause 2: OS-Level Resource Limits (ulimit)

If the Oracle OS user's nproc (max processes) or nofile (file descriptors) limits are too low, the OS will refuse to create new processes regardless of Oracle settings.

-- Check PGA and process memory consumption
SELECT SPID, PROGRAM,
       ROUND(PGA_ALLOC_MEM / 1024 / 1024, 2) AS PGA_MB
FROM V$PROCESS
ORDER BY PGA_ALLOC_MEM DESC
FETCH FIRST 15 ROWS ONLY;

-- Check overall SGA/PGA sizing
SELECT NAME,
       ROUND(BYTES / 1024 / 1024, 2) AS SIZE_MB
FROM V$SGAINFO
WHERE NAME IN ('Total SGA Size', 'Free SGA Memory Available');

-- Verify OS limits from SQL context (informational)
-- Run on OS shell:
-- $ ulimit -u   (should be >= 16384 for Oracle)
-- $ ulimit -n   (should be >= 65536 for Oracle)
-- Edit /etc/security/limits.conf:
-- oracle soft nproc  16384
-- oracle hard nproc  16384
-- oracle soft nofile 65536
-- oracle hard nofile 65536
Enter fullscreen mode Exit fullscreen mode

Cause 3: Listener Misconfiguration or Stale State

An incorrect listener.ora, mismatched service names, or a corrupted listener state can all cause the listener to fail when handing off connections.

-- Force dynamic re-registration of the DB with the listener
ALTER SYSTEM REGISTER;

-- Verify listener-related parameters
SHOW PARAMETER LOCAL_LISTENER;
SHOW PARAMETER SERVICE_NAMES;

-- Check registered services
SELECT NAME, NETWORK_NAME
FROM V$ACTIVE_SERVICES
ORDER BY NAME;

-- Find the alert log and listener log location
SELECT NAME, VALUE
FROM V$DIAG_INFO
WHERE NAME IN ('Diag Trace', 'Alert Log');
Enter fullscreen mode Exit fullscreen mode

OS commands to restart the listener:

lsnrctl stop
lsnrctl start
lsnrctl status

Quick Fix Checklist

  1. Run lsnrctl status — confirm the listener is actually running.
  2. Check V$RESOURCE_LIMIT — look at MAX_UTILIZATION vs LIMIT_VALUE for processes.
  3. Review the alert log (alert_<SID>.log) for ORA-27300/ORA-27301 entries that indicate OS-level fork failures.
  4. Kill idle/zombie sessions immediately to free process slots.
  5. Increase PROCESSES and restart the database if limits are consistently near capacity.

Prevention Tips

Monitor proactively: Set up an OEM metric alert (or a custom cron job) to fire when session utilization exceeds 80% of the PROCESSES limit. Catching this early prevents total lockout.

-- Sample monitoring query (schedule via DBMS_SCHEDULER)
SELECT ROUND(CURRENT_UTILIZATION / LIMIT_VALUE * 100, 1) AS PCT_USED
FROM V$RESOURCE_LIMIT
WHERE RESOURCE_NAME = 'processes';
Enter fullscreen mode Exit fullscreen mode

Cap connection pools: Configure your application connection pool's maximum size to no more than 70–75% of the PROCESSES value. This leaves headroom for DBA sessions and background processes and is the single most effective way to prevent ORA-12500 in production environments.


Related Errors

Error Code Description
ORA-12518 Listener could not hand off client connection
ORA-12514 Listener does not know of requested service
ORA-00020 Maximum number of processes exceeded
ORA-27300/27301 OS process creation failure (appears in alert log alongside ORA-12500)

📖 Want a more detailed guide?
Check out the full in-depth version (Korean) on oraerror.com — includes detailed analysis, additional SQL examples, and prevention tips.

Top comments (0)