Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: OCI sends duplicate TNS packet to Oracle server ?

Re: OCI sends duplicate TNS packet to Oracle server ?

From: Karsten Farrell <kfarrell_at_belgariad.com>
Date: Thu, 03 Apr 2003 21:05:35 GMT
Message-ID: <MPG.18f641e7c7083df2989716@news.la.sbcglobal.net>


bsssrinivas_at_lycos.co.uk said...
> Hi,
>
> I am working with ODBC driver which uses OCI calls to interact
> with Oracle on Solaris. Oracle version is 8.1.6. When the
> following query:
>
> "select col1 from tab1 where n=?"
>
> is executed via ODBC with 'xyz' to the bind variable, it causes
> the following packet transaction over the network(obtained from
> sniffing packets at Oracle server on port 1521)
>
> 1. Connection establishment packets between ODBC client and
> Oracle server
> 2. Request(TNS) from ODBC client with the data "select col1
> from tab1 where n=:P0......" Note that no value has been
> sent for the bind variable.
> 3. Response(TNS) from Oracle server with no data for the
> request sent in step 2.
> 4. Request(TNS) from ODBC client with the data "select col1
> from tab1 where n=:P0 xyz"
> 5. Response(TNS) from Oracle server with valid data for the
> request sent in step 4.
> [...]
>
> Why a dummy TNS request in step 2 is being sent from ODBC ?
> Is there anything that could cause this scenario in OCI(ODBC
> driver which I am using is written in OCI) ?
>
> Has any one observed this behavior earlier ? Any ideas to
> overcome ?
>
> Thanks,
> Srinivas.
>
>

If these are the *only* packets, then you might be seeing false clues. I've never sniffed, so I don't know what data the packets contain. But using your step numbers, here's what would happen at the "logical" level (very brief):

  1. Client (ODBC) looks up connection parameters in tnsnames.ora.
  2. Client sends a connection request to Listener on server port 1521 (by default), requesting that a Server process be assigned.
  3. Listener responds with random port over which Client and Server process can communicate.
  4. Client uses assigned random port to send SQL to Server process. Server process passes it to the database to be executed.
  5. Server process sends result set back to Client. -- /Karsten DBA > retired > DBA
Received on Thu Apr 03 2003 - 15:05:35 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US