TNS-12520: cannot connect
When to use it
New connections fail with TNS-12520 or ORA-12520 (listener could not find available handler), while existing sessions keep working.
Run this
Connect locally on the server, which does not go through the listener, and check the limits:
sqlplus / as sysdba
SELECT resource_name, current_utilization, max_utilization, limit_value
FROM v$resource_limit
WHERE resource_name IN ('processes', 'sessions');
Full guided diagnosis: diagnose_tns_12520.sh (Administration › Utility scripts › Connectivity): checks process limits in the database and the operating system, the listener services and the PDB state. The last steps of that script close and reopen a PDB: do not run those without approval.
How to read the output
- If
current_utilizationforprocessesis at or very nearlimit_value, the database has no room for new connections. This is the most common cause. - If there is room, check the listener with
lsnrctl services. A service in stateblockedor missing from the list points to registration problems. - If you cannot connect locally either, the problem is bigger than the listener. Escalate.
What to do next
- Find out which user holds the sessions with "Who is connected" in chapter 4 and tell the application team.
- Freeing sessions means killing them, which needs confirmation. See "Killing a session safely".
- A permanent fix (a higher
processesvalue, a smaller connection pool) is a decision for a senior DBA.
Risk level
READ ONLY Safe to run at any time. It only queries the data dictionary.