My queries take minutes to complete when using Oracle HSODBC. What can I do?

You may get the following errors when running a query that takes some time to complete (for example, when fetching a large result set or running select count(*) against a large table):

ORA-02068: following severe error from <link name>
ORA-28511: lost RPC connection to heterogeneous remote agent using

If you turn on HSODBC tracing, the trace output will indicate that:

The problem happens because Oracle times out the database link when it takes a long time to get the data from Oracles SQL*Net layer to HSODBC.

You may also get these errors:

ORA-12637: Packet receive failed

ORA-12170: TNS:Connect timeout occurred

ORA-12547: TNS:lost contact

Refer also to the related Oracle bugs #6242391 (Oracle 10) and bug #5753490 (accessible from the Oracle Support portal.)

We worked around this issue by adding:

SQLNET.INBOUND_CONNECT_TIMEOUT=0

to sqlnet.ora.

This setting prevents Oracle from timing out the database link. Refer to the Profile Parameters (sqlnet.ora) in the Oracle Database Net Services Reference Guide for full information on SQLNET.INBOUND_CONNECT_TIMEOUT.

This issue was reported to us by a customer who was using the SQL Server ODBC driver version 1.2 with Oracle 10.2.0.4 on an AIX platform. It's also a known problem with: