Discussions
Categories
- 196.9K All Categories
- 2.2K Data
- 239 Big Data Appliance
- 1.9K Data Science
- 450.3K Databases
- 221.7K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 550 MySQL Community Space
- 478 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3K ORDS, SODA & JSON in the Database
- 545 SQLcl
- 4K SQL Developer Data Modeler
- 187K SQL & PL/SQL
- 21.3K SQL Developer
- 295.9K Development
- 17 Developer Projects
- 138 Programming Languages
- 292.6K Development Tools
- 107 DevOps
- 3.1K QA/Testing
- 646K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 155 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.1K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 18 Java Essentials
- 160 Java 8 Questions
- 86K Java Programming
- 80 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 204 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 440 LiveLabs
- 38 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 171 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 232 Portuguese
TNS:listener could not find available handler witht matching protocol stack

447039
Member Posts: 8
Hi
We have a .net application and we recently started getting this error message. This message pops up randomly while executing different pages. Did any of you encounter this problem. Any help is really appreciated.
OracleException: ORA-12516: TNS:listener could not find available handler with matching protocol stack]
Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure) +634
Oracle.DataAccess.Client.OracleConnection.Open() +2943
HHMI.TA.Data.DataAccess.OpenConnection() in c:\inetpub\wwwroot\TA\Data\DataAccess.vb:67
Thanks in advance
Sirisha
We have a .net application and we recently started getting this error message. This message pops up randomly while executing different pages. Did any of you encounter this problem. Any help is really appreciated.
OracleException: ORA-12516: TNS:listener could not find available handler with matching protocol stack]
Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure) +634
Oracle.DataAccess.Client.OracleConnection.Open() +2943
HHMI.TA.Data.DataAccess.OpenConnection() in c:\inetpub\wwwroot\TA\Data\DataAccess.vb:67
Thanks in advance
Sirisha
Comments
-
One more note to the message. when I restart the database service, the application works fine. When I get this error, I did a tnsping and tnsping didnt give any errors.
Thanks,
Sirisha -
This is an issue your DBA needs to address, it is not due to your client application --
Here is a Metalink note I found - for further information you will need to contact support.
Article-ID: Note 240710.1
Title: Intermittent TNS-12516 or TNS-12519 Errors Connecting Via
Net
Symptom(s)
~~~~~~~~~~
Client connections may intermittently fail with either of the following errors:
TNS-12516 TNS:listener could not find instance with matching protocol stack
TNS-12519 TNS:no appropriate service handler found
Additionally, a TNS-12520 error may appear in the listener log.
TNS:listener could not find available handler for requested type of server
The output of the lsnrctl services command may show that the service handler
is in a "blocked" state.
e.g. '"DEDICATED" established:1 refused:0 state:blocked'
Change(s)
~~~~~~~~~~
None necessarily. Perhaps increase in load.
Cause
~~~~~~~
By way of instance registration, PMON is responsible for updating the listener
with information about a particular instance such as load and dispatcher
information. Maximum load for dedicated connections is determined by the
PROCESSES parameter. The frequency at which PMON provides SERVICE_UPDATE
information varies according to the workload of the instance. The maximum
interval between these service updates is 10 minutes.
The listener counts the number of connections it has established to the instance
but does not immediately get information about connections that have terminated.
Only when PMON updates the listener via SERVICE_UPDATE is the listener
informed of current load. Since this can take as long as 10 minutes, there can be
a difference between the current instance load according to the listener
and the actual instance load.
When the listener believes the current number of connections has reached maximum
load, it may set the state of the service handler for an instance to "blocked"
and begin refusing incoming client connections with either of the following
errors:
TNS-12516 TNS:listener could not find instance with matching protocol stack
TNS-12519 TNS:no appropriate service handler found
Additionally, a TNS-12520 error may appear in the listener log.
The output of lsnrctl service may show that the service handler is "blocked".
e.g. '"DEDICATED" established:1 refused:0 state:blocked'
Fix
~~~~
Increase the value for PROCESSES. -
The problem is you opened to much connection.
public static void OpenConnection()
{
//open connection once in the beginning or if the connection is closed during session, reopeon it
if (conn == null || conn.State != ConnectionState.Open)
{
conn = new OracleConnection("Data Source=localhost/XE;Persist Security Info=True;Password=a;User ID=a;");
conn.Open();
}
}
call this function in the beginning of you asp.net code and don't call any close conncetion. The application cache everything, so for every time you load a new page, it open a new connection -
call this function in the beginning of you asp.net code and don't call any close conncetionI'd definitely call close at the end of the page processing code if you're using ASP.NET. That will put the connection back in the pool. I wouldn't want to trust the Framework to do it for you because that may not happen until garbage collection, and by then the connection will likely be stale.
Eric -
I also get this error intermittently, however only when using Oracle.DataAccess.Client (ODP.Net) and never with System.Data.OracleClient. Is this really a DBA issue or is it a problem with the provider or maybe a missing setting in the connection string?
-
It should be verified the number of concurrent conections to the database. If maximum DB processes parameter has been reached this is a common symptom.
~ Madrid. -
Hi there,
Years later, I'm getting this same error. I have an asp.net web application that does a lot of database insert, although I'm careful to close the connections after I'm done each time, I get the tns error ORA-12516: TNS:listener could not find available handler with matching protocol stack.
I'm not an Oracle DBA but I still need to fix this error on my own. I use Oracle xe 10g and Oracle 9i client and know enough oracle to develop applications.
Thanks. -
Please post issue on the oracle xe discussion forum as this is a db issue.
-
Thanks everyone here for sharing the root cause.
I checked in my database, the processes parameter is set to 200. And no. of connections to db were going above 190+.
After bouncing the database, the issue seems to be resolved.
regds,
Anjul
This discussion has been closed.