ORA-12518: TNS: listener could not hand off client connection
ORA-12518 occurs when the Oracle TNS listener receives a client connection request but fails to hand it off to a database server process. This typically means the database cannot spawn a new dedicated server process due to resource exhaustion or configuration issues. It is a critical error that prevents clients from connecting entirely and requires immediate attention in production environments.
Top 3 Causes and Fixes
Cause 1: PROCESSES Parameter Limit Exceeded
This is the most common cause. When the number of active Oracle processes reaches the PROCESSES initialization parameter limit, no new server processes can be created.
-- Check current PROCESSES limit vs. actual usage
SELECT
(SELECT VALUE FROM V$PARAMETER WHERE NAME = 'processes') AS max_processes,
(SELECT COUNT(*) FROM V$PROCESS) AS current_processes,
ROUND(
(SELECT COUNT(*) FROM V$PROCESS) /
(SELECT TO_NUMBER(VALUE) FROM V$PARAMETER WHERE NAME = 'processes') * 100, 2
) AS usage_pct
FROM DUAL;
-- Increase PROCESSES limit (requires database restart)
ALTER SYSTEM SET PROCESSES = 500 SCOPE = SPFILE;
ALTER SYSTEM SET SESSIONS = 555 SCOPE = SPFILE;
-- Restart the database to apply changes
SHUTDOWN IMMEDIATE;
STARTUP;
Rule of thumb: Set
SESSIONS = PROCESSES * 1.1 + 5. Monitor usage and keep it below 80%.
Cause 2: OS-Level Resource Exhaustion
Even if the Oracle parameter allows more connections, the OS may not have enough memory, swap space, or file descriptors to spawn new server processes.
# Check memory and swap
free -m
# Check Oracle user's file descriptor limits
ulimit -a
# Check open files by oracle user
lsof -u oracle | wc -l
-- Check PGA usage inside Oracle
SELECT
NAME,
ROUND(VALUE / 1024 / 1024, 2) AS size_mb
FROM V$PGASTAT
WHERE NAME IN (
'total PGA inuse',
'total PGA allocated',
'maximum PGA allocated'
);
-- Check SGA component sizes
SELECT POOL, NAME, ROUND(BYTES / 1024 / 1024, 2) AS size_mb
FROM V$SGASTAT
ORDER BY BYTES DESC
FETCH FIRST 10 ROWS ONLY;
Fix: Increase OS ulimit values in /etc/security/limits.conf and ensure sufficient swap space is available.
Cause 3: Listener and Instance Registration Failure
If the database instance is not properly registered with the listener (e.g., PMON failed to register), the listener cannot hand off connections even if it is running.
-- Check listener-related parameters
SHOW PARAMETER LOCAL_LISTENER;
SHOW PARAMETER SERVICE_NAMES;
-- Force PMON to re-register with the listener
ALTER SYSTEM REGISTER;
-- Verify registered services
SELECT NAME, NETWORK_NAME, CREATION_DATE
FROM V$SERVICES;
# Check listener status and registered services
lsnrctl status
lsnrctl services
# Restart listener if needed
lsnrctl stop
lsnrctl start
Quick Fix Checklist
-- Step 1: Confirm the error in alert log
SELECT ORIGINATING_TIMESTAMP, MESSAGE_TEXT
FROM V$DIAG_ALERT_EXT
WHERE MESSAGE_TEXT LIKE '%ORA-12518%'
ORDER BY ORIGINATING_TIMESTAMP DESC
FETCH FIRST 10 ROWS ONLY;
-- Step 2: Check process usage ratio
SELECT COUNT(*) AS current_processes FROM V$PROCESS;
-- Step 3: Force service re-registration
ALTER SYSTEM REGISTER;
-- Step 4: If processes maxed out, increase and restart
ALTER SYSTEM SET PROCESSES = 500 SCOPE = SPFILE;
-- Then: SHUTDOWN IMMEDIATE; STARTUP;
Prevention Tips
Automate monitoring: Schedule a job to alert when process/session usage exceeds 80% of the configured limit. Use Oracle Enterprise Manager, custom scripts, or third-party tools to track
V$PROCESSandV$SESSIONcounts continuously.Use Connection Pooling wisely: Configure application-side connection pool maximums so that the total connections from all application servers stay within 70–80% of Oracle's
PROCESSESlimit. Consider using Oracle DRCP (Database Resident Connection Pooling) for high-concurrency environments to dramatically reduce the number of dedicated server processes required.
Related Errors
- ORA-00020 – Maximum number of processes exceeded (direct cause of ORA-12518)
- ORA-12519 – No appropriate service handler found
- ORA-12514 – Listener does not know of requested service
- ORA-12541 – No listener running
📖 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)