Ping utility (dbping)

The command-line Ping utility dbping assists in diagnosing connection problems.

Syntax

dbping [options]

Parameters

Table 4-8 lists the available options for dbping.

Table 4-8: dbping options

Option

Description

-c "keyword=value; ..."

Supply database connection parameters. See Chapter 4, “Connection and Communication Parameters” in the System Administration Guide: Volume 1. If no connection parameters are specified, connection parameters from the SQLCONNECT environment variable are used, if set.

-d

Make a database connection if the server is found.

If you do not supply the -d option, dbping reports success if it finds the server specified by the -c option. If you do supply the -d option, dbping reports success only if it connects to both server and database.

For example, if you have a server named blair running the iqdemo database, this command succeeds:

dbping -c "eng=blair;dbn=iqdemo"

The following command fails, with the message Ping database failed -- specified database not found

dbping -d -c "eng=blair;dbn=iqdemo"

-en

Specifies that you want dbping to exit with a failed return code when NULL is returned for any of the properties specified. By default, dbping prints NULL when the value for a property specified by -pc, -pd, or -ps is unknown, and exits with a success return code. This option can only be used with -pc, -pd, and -ps.

-l library

Use the specified ODBC driver or driver manager library. Specify the library to use (without its file extension). This option does not use the ODBC Driver Manager, and so is particularly useful on UNIX operating systems.

For example, this command directly loads the ODBC driver:

dbping -m -c "dsn=IQ15iqdemo" -l dbodbc11

Use dbping to verify connectivity with the ODBC Driver Manager on UNIX systems. Unlike dbisql or other tools, dbping allows you to explicitly test the components as you would with a third-party tool. For example:

dbping -m -c "dsn=dsnname" -l /<full path>/libodbc.so

where libodbc.so is the third-party ODBC driver.

-m

Use the ODBC Driver Manager. Otherwise, connect using Embedded SQL™. Establish a connection using ODBC. By default, dbping attempts a connection using the embedded SQL interface.

-o filename

Log output messages to a file.

-pc property,…

Upon connection, display the specified connection properties. Supply the properties in a comma-separated list. You must specify enough connection information to establish a database connection.

For a list of connection properties, see "Connection properties" in SQL Anywhere Server – Database Administration.

-pd property,…

Upon connection, display the specified database properties. Supply the properties in a comma-separated list. You must specify enough connection information to establish a database connection.

For a list of database properties, see "Database properties" in SQL Anywhere Server – Database Administration.

-ps property,…

Upon connection, display the specified database server properties. Supply the properties in a comma-separated list.

For a list of database server properties, see "Database server properties" in SQL Anywhere Server – Database Administration.

-q

Operate quietly—do not print messages. If dbping fails, a message always appears.

-s

Returns information about the performance of the network between the computer running dbping and the computer running the database server. Approximate connection speed, latency, and throughput are displayed. The -c option is usually required to specify the connection parameters to connect to a database on the server. You can only use dbping -s for embedded SQL connections. This option is ignored if -m or -l is also specified. By default, dbping -s loops through the requests for at least one second for each statistic it measures. A maximum of 200 connect and disconnect iterations are performed, regardless of the time they take, to avoid consuming too many resources. On slower networks, it can take several seconds to perform the minimum number of iterations for each statistic. The performance statistics are approximate, and are more accurate when both the client and server computers are fairly idle.

-st time

This option is the same as -s, except that it specifies the length of time, in seconds, that dbping loops through the requests for each statistic it measures. This option allows more accurate timing information to be obtained than -s.

-z

Display debugging information. This option is available only when an embedded SQL connection is being attempted. That is, it cannot be combined with -m or -l. It displays the network communication protocols used to attempt connection, and other diagnostic messages

Usage

Use dbping to help debug connection problems. You can enter a full or partial connection string; the utility returns a message indicating whether the attempt to locate a server or database, or to connect, was successful.

Use dbping for Embedded SQL or ODBC connections. You cannot use dbping for jConnect (TDS) connections.

Exit codes are 0 (success) or nonzero (failure).

This utility accepts @filename parameters.