title: Unreliable Oracle connection (intermittent error "Connect failed because target host or object does not exist")
body: <p>We recently changed physical DB's, new servers, new locations, same database schema and data and since the change over, whenever we try to connect directly to the DB in our own desktop type applications about half of the time we get this error:</p>
  <pre><code>SQL*Loader-704: Internal error: ulconnect: OCIServerAttach[0]
  ORA-12545: Connect failed because target host or object does not exist
  </code></pre>
  <p>The rest of the time, it connects right away without any issues.  Our applications that establish connections via JDBC don't seem to have any issues but we do when going through something that does a tnsnames.ora lookup (or that's my hunch at least).  TNSPING works 100% but using an oracle executable like SQLLDDR fails at least 50% of the time.  Here's an anonymized snppet of our TSNNAMES file and a TNSPING output:</p>
  <pre><code>DB_CONNECTION =
    (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = 1.2.3.4)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = MY.URL.COM)
    )
  )
  </code></pre>
  <p>And the TNSPING:</p>
  <pre><code>C:\&gt;TNSPING DB_CONNECTION
  TNS Ping Utility for 32-bit Windows: Version 9.2.0.1.0
  
  Copyright (c) 1997 Oracle Corporation.  All rights reserved.
  
  Used parameter files:
  C:\oracle\ora92\network\admin\sqlnet.ora
  
  
  Used TNSNAMES adapter to resolve the alias
  Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
  (HOST = 1.2.3.4)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = MY.URL.COM)))
  OK (200 msec)
  </code></pre>
  <p>I have the SID of the DB, which is what the JDBC connections rely on but adding it to the tnsnames.ora doesn't improve the odds of making a connection.  I don't know enough about how the tnsnames file is being used by Oracle to intelligently resolve this issue. What can I try?</p>
  <h2>Edit</h2>
  <p>The new DB's may be two load balanced databases which may be part of the problem.</p>