The forum will be down for scheduled maintenance on Saturday, March 4 beginning at 10am EST. Actual downtime is unknown but may be several hours.

Can someone tell me why dblocate finds the SQL Anywhere network server running on my TCP/IP network, but dbping does not find it? The server is running on the default port, firewalls are disabled on client and server, and I call dbping or dblocate from the client computer without any switches. If it makes a difference, the dbping and dblocate programs are a slightly older version, 10.0.1.3976, than the server, 10.0.1.4051.

asked 17 Jun '10, 02:39

rbiffl's gravatar image

rbiffl
203357
accept rate: 0%


dbping and dblocate are quite different applications but may under the cover use similar but functionally different mechanisms to find a server.

dblocate uses UDP broadcasts to the local network(s) to attempt to find all SQL Anywhere database servers. When each SA server receives the broadcast message, they each respond with a directed UDP response packet back to the sender to report its IP address and port number that can be used to connect to the server. Note that the port on which the server is listening for UDP broadcasts can be different than the port on which it will accept TCP connection - this happens in the case that you have specified a different port (than 2638) when you started the server. E.g. If you specified: "dbsrvX -x tcpip{port=1234}" then the server will listen for UDP broadcasts on both port 2638 and 1234 but will only listen for TCP connections on port 1234. Note also that a server will not respond to the UDP broadcast if it was started with "-sb 0" switch. i.e. "stealth mode".

dbping is really just a normal client application that you or I could write. It uses the connection string that has been given to it and/or uses SQLCONNECT environment variable value to attempt to make a connection to an SA server and database running on that server. If no connection string is given and no SQLCONNECT value is set then dbping, like any other db client application, will attempt to connect to the default database running on the default server on the same computer (as dbping) using a shared memory connection. Additional options can be given to dbping to cause it to report one or more properties of the server/database once the connection has been made.

I should also note that dbping, like all client applications, may use a UDP broadcast in some circumstances to find the named server that you specified in the connection string. E.g. if you give the connection string "-c servername=myserver;links=tcpip" then under the covers the client db library will send a UDP broadcast to the local network(s) to find the named server "myserver". In this case only the server that is named "myserver" will respond back to the client to say where it is (ip address and port number). The difference between this broadcast and the one used by dblocate is that the presence of the name of the server that is trying to be found.

So as you can see dblocate is a specialize applications that can be used to find any server that exists on the local network without knowing the name(s) whereas dbping, like all client applications, is a generic client application and must know the name of the server (under normal circumstances - i.e. there are some exceptions to this rule) in order to find and connect to the server.

permanent link

answered 17 Jun '10, 13:24

Mark%20Culp's gravatar image

Mark Culp
22.5k9129264
accept rate: 40%

edited 17 Jun '10, 14:34

2

Note that dblocate is also just a client application - it uses the db_locate_servers_ex function in dblibX.dll to get all the server names. Using this function, you could write your own version of dblocate with identical functionality - we've just done it for you.

(17 Jun '10, 15:24) Graeme Perrow

@Graeme: That's just fitting to your mission statement "We do the hard part", isn't it:)

(17 Jun '10, 15:29) Volker Barth

AFAIK, DBPING needs a connection string (specified with option -c).

If no connection string is given (as in your case), then the value of the environment variable SQLCONNECT is used. When SQLCONNECT is not filled, and you don't specify a connection string, then a "Server nor found" message is expected.

So there's obviously a difference in the usage of DBPING and DBLOCATE:)


According to Mark's much better explanation, I should add:

In case of a missing connection string and an empty/missing SQLCONNECT variable, the search for the default server/database on the local machine takes place - so even then you could find a server.

permanent link

answered 17 Jun '10, 12:47

Volker%20Barth's gravatar image

Volker Barth
29.5k291441646
accept rate: 32%

edited 17 Jun '10, 14:41

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×3
×2
×1

question asked: 17 Jun '10, 02:39

question was seen: 1,959 times

last updated: 17 Jun '10, 14:41