ORA-03135: connection lost contact - oracle

I am getting the error as 'ORA-03135: connection lost contact' from my C# code while making connection to oracle DB. The same job works just fine from our test server. But it failed with ORA-03135: connection lost contact error from prod server.
The C# code use ODAC to connect to oracle DB.
Appreciate your inputs.
Thank you

This error is most likely caused by a firewall blocking the connection request. Check for any firewalls in your network or on the database server and make sure your access rules are configured correctly.
Also check this link for more troubleshooting tips: http://www.dba-oracle.com/t_ora_03135_connection_lost_contact.htm
ORA-03135: connection lost contact tips
What can I do to avoid the ORA-03135 error?
Answer: The oerr utility shows this for the ORA-03135 error:
ORA-03135: connection lost contact
Cause:
1) Server unexpectedly terminated or was forced to terminate.
2) Server timed out the connection.
Action:
1) Check if the server session was terminated.
2) Check if the timeout parameters are set properly in
sqlnet.ora.
The ORA-03135 error is common when connecting remotely when a firewall
terminates the connection.
One solution for the ORA-03135 error is to increase the value of the
sqlnet.ora expire_time parameter in the sqlnet.ora file or to check
for a expire parameter in a SQL*Plus profile.
To diagnose the ORA-03135 error, start by checking to see if the OS
PID still exists, using the "ps -ef | grep" syntax.
Check to see if there is a Network Address Translation (NAT) between
the client and server
In Windows, check to see if a Windows firewall is checking for your
local connections.
...
Also, setting the parameters sqlnet.inbound_connect_timeout and
inbound_connect_timeout_listenername to 0 can stop the ORA-03135
error.

Related

How can i solve this issue through Sql Developer with Oracle

Status : Failure -Test failed: Listener refused the connection with the following error:
ORA-12518, TNS: listener could not hand off client connection
Please follow below mentioned steps:
1.Processes parameter and verified by the v$resource_limit view.
2.If you are using a shared server, you may increase the number of dispatchers.
3.Check the alert log for any possible errors.
4.Check the swap, memory usage of the OS.
5.Check the Sid name of database
Action: Turn on listener tracing and re-execute the operation. Verify that the listener and database instances are properly configured for direct handoff.

IBM MQ client 7.5 MQRC_HOST_NOT_AVAILABLE

We've tryed to test connection to the remote queue manager after installing MQ client v7.5 on Windows Server 2019. We've used Rfhutilc for this and got 'Host not available' inspite of the fact that telnet connection to the corresponding address was succecfully established. Also we tryed to connect using MQ client v9.0 with the same result.
AMQERR01.LOG (client v.7.5) reported following details:
29.09.2020 15:36:10 - Process(10828.2) User(Администратор) Program(rfhutilc.exe)
Host(-) Installation(Installation1)
VRMF(7.5.0.6)
AMQ9208: Error on receive from host 'X.X.X.X'.
EXPLANATION: An error occurred receiving data from 'X.X.X.X' over TCP/IP. This may be due to a communications failure.
ACTION: The return code from the TCP/IP recv() call was 10054 (X'2746'). Record these values and tell the systems administrator.
----- amqccita.c : 4065 -------------------------------------------------------
29.09.2020 15:37:56 - Process(10828.1) User(Администратор) Program(rfhutilc.exe)
Host(-) Installation(Installation1)
VRMF(7.5.0.6)
AMQ9202: Remote host 'X.X.X.X' not available, retry later.
EXPLANATION: The attempt to allocate a conversation using TCP/IP to host 'X.X.X.X' was not successful. However the error may be a transitory one and it may be possible to successfully allocate a TCP/IP conversation later.
ACTION: Try the connection again later. If the failure persists, record the error values and contact your systems administrator. The return code from TCP/IP is 10060 (X'274C'). The reason for the failure may be that this host cannot reach the destination host. It may also be possible that the listening program at host 'X.X.X.X' was not running. If this is the case, perform the relevant operations to start the TCP/IP listening program, and try again.
Here is an example of how traffic data looks like when Rfhutilc refuses to connect to the queue.
As soon as according to the picture there was some code page issue we've tryed to set MQCCSID environment variable with the value 1208 and it helpled.
Also connection attempt via Rfhutilc was succeful while running under another user with login "admin" even though without setting MQCCSID variable.
But I failed to find explanation for this. Did the CCSID of the MQ client differ from system code page of what? And how could I find out default CCSID of MQ client then?
MQ client v7.5 worked just fine on the Windows Server 2012 R2 right after installing. Rfhutilc v7.5 was used both on Server 2012 and Server 2019 for testing.

DB Link throws ORA-28511: lost RPC connection to heterogeneous remote agent using SID

I use a DBLINK/Oracle Gateway to connect to an external non-oracle database. i have a timeout setting of 5 minutes.
when I connect using dblink, for the first time, it runs fine. After the idle time of 5 minutes, when I run the same sql again, it throws me the bellow error -
ORA-28511: lost RPC connection to heterogeneous remote agent using SID. ****
ORA-28509: unable to establish a connection to non-Oracle system
ORA-02063: preceding line from DB2T
Then when i run the sql again, its connecting fine. i guess its establishing a new connection.
Why am i getting the connection error and why oracle is not simply establishing a new connection when the previous connection is timed out?
Is there a way to not get the error and connect seamlessly or to suppress the error?
Easily replicable in sql developer by running a sql and waiting for 5 minutes.
Thanks in Advance.

java.sql.SQLRecoverableException: Connection has been administratively disabled by console/admin command. Try later

When our application tries to connect Oracle database, this exception is thrown:
java.sql.SQLRecoverableException: Connection has been administratively disabled by console/admin command. Try later. java.lang.Exception: It was disabled at Tue Oct 20 23:55:14 CEST 2015
But, from Weblogic console the connection test returns OK.
Weblogic version: 12.1.3.0.0
Any explanation is welcome. Thanks
The reason the test works is because that is creating a connection and running a test query. That is not what your code is doing when it is using the data source in an ejb. The code is going through the connection pool and that is what has been marked as bad. There is no solution provided by Oracle that I have found except to: restart the server and that will re-enable the connection pool.
I suspect you have "Test connections on reserve" set because that is when this usually arises. What Weblogic does is: before it returns a connection from the pool it will run a test query, if the test query fails it waits and runs it one more time. If the query fails again it marks the connection as unhealthy. If all the connections in the pool become unhealthy it will mark the pool as disabled and gives you the error message you see: 'Connection has been administratively disabled by console/admin command. Try later.'
In regards to the 'Try Later' part of the error message, as far as I can tell Oracle is wrong about trying again later. I have never seen it recover later.
I'd like to share this article that help me out to understand better my problem:
https://www.techpaste.com/2012/09/connection-administratively-destroyed-reconnect-oracle-weblogic-server/
The “java.sql.SQLException: Connection has been administratively destroyed.” is expected:
the DB was shutdown; even if it was restarted later, the JDBC connection are pointing to DB processes
that have been destroyed.
You need to restart your WebLogic Server to recreate new JDBC connections.
All the current transactions are lost, as the database was shutdown.
High availability of your RDBMS is required to minimize this issue.
Is there any other error before that one ?
Maybe in the log you can find that connection is been closed.
You can avoid this by selecting "Test on Connection Reserve" in the datasource.

Oracle OLEDB Connection Pooling and Invalid Connections

We are using ADO to access Oracle 10g release 2, Oledb provider for Oracle 10g. We are facing some issue with the connection pooling. The database reside on the remote machine and connection pooling is occuring as it should. But if the remote machine goes down for some reason, the connection is returned from the pool and query on that connection fails. When this connection is closed, it is returned back to the pool instead of being invalid. The subsequent connection opening requests are sucessfull but query fails. This is strange behaviour, according to OLEDB specifications, provider must support DBPROP_CONNECTIONSTATUS property, thus in case of invalid connection, it would not be returned back to the pool.
Things get weired when the remote machine comes up. The connections in the pool are still invalid and although the connection opening succeeds, query on the connection fails. Oracle OLEDB is unable to connect to the server anymore and we have to restart our application. Well this is undesired cause our application is a critical application.
Any ideas on how to get over this.
Thanks
Mubashir
If you are doing this programmatically, use a try block, so that if something does happen, it won't fail. With a try block, you can catch an exception and ignore it, so that the errors are shushed.
You could tell the pool to not accept invalid connections, by marking the connection invalid before it is returned to the pool.
Connections are recovered after 10 minutes by default. Time can be set by the registry key SPTimeout under the oledb provider's root key.
Actually the default connection pool timeout is 120 seconds at least for this Oracle 11 32-bit OLEDB installation. You can find the registry settings at:
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Oracle\KEY_orac
Where KEY_orac is the KEY_<oracle_home_name>
The key name is ORAMTS_CONN_POOL_TIMEOUT and the default value is 120.
It does not appear that you can set connection pool parameters at the connection string level.
In most connection pool implementation it is possible to check the connection before using it. For example: you define a check query like select * from dual and if you pick up a connection from the pool this query will be executed. If it fails, then the connection will be excluded from the pool and a new one will be opened.

Resources