ORA-12520: TNS: Listener could not find available handler for requested type of server

We got the above error running an Oracle Standard Edition Database with a Standby DB protected by Dbvisit Standby, where we have added a special service for the application that registered the service at a remote listener. 

The configuration a little bit more detailed:

  • a database Prod with the db_unique_name Prod_DC1 (datacenter 1) and a standby database with the db_unique_name Prod_DC2 (datacenter 2) - version 19c
  • the Prod database is a CDB with a pluggable database PDB1
  • an additional service was created called PDB1app on the PDB1
  • a Windows VM is used where an application server was running on for the application, "VMAppl1" 
  • A remote listener is configured at the "VMAppl1" for the database services running on both machines that should be used high available with Standard Edition 2 (as the Connection Manager (CMAN) is part of the Enterprise Edition license only)
  • Therefore, the spfile of Prod_DC1 and Prod_DC2 had an entry "remote_listener" which points to the VMAppl1 remote listener

Everything worked well, but after a while the customer complained about random ORA-12520 errors when he tries to connect to the PDB1app service using the remote listener, sometime it worked in one second and the next two seconds he got an error. 

If he used the local listener of the oracle database machine the service was running/started on, the ORA-12520 errors where gone. The error was raised not only with the application, it was reproducible also with SQL*Plus.

Due to high availability constraints in the case of a switchover or failover, the application server and the end users should not work with the both hosts, but with a central remote listener. The application itself can not use tnsnames or the failover technology from a jdbc driver e.g.. 

At the listener log we only found a lot of "service registration" entries, but nothing that pointed directly to an error. After some more tests and some configuration checks we have found the root cause for this issue. Someone has set the "local_listener" entry on the PDB1 to "localhost:1521". We have resetted the value and the issue was gone. This is/was a misconfiguration done while the application in the database was upgraded. 

Nevertheless - in my opinion all "listener" parameters (like remote_listener, local_listener and listener_networks) should be bound to the root container, regardless what is configured in a pluggable database. 

So, if you do run into an ORA-12520 with a container database - in additon to the official support notes (regarding number of processes,...), please check if the listener_* parameters at PDB level are all empty. If not, reset them.