Ping utility (dbping)

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

Syntax

dbping [options]

Parameters

Table 3-7 lists the available options for dbping.

Table 3-7: dbping options

Option

Description

-c "keyword=value; ..."

Supply database connection parameters.

-d

Make a database connection if the server is found.

-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 in conjunction with -pc, -pd, and -ps.

-l library

Use the specified ODBC driver or driver manager library.

-m

Use the ODBC Driver Manager. Otherwise, connect using Embedded SQL™.

-o filename

Log output messages to a file.

-pc property,…

Report specified connection properties.

-pd property,…

Report specified database properties.

-ps property,…

Report specified database server properties.

-q

Operate quietly—do not print messages.

-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

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.

Options

Connection parameters (-c) 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.

Make database connection (-d) Ping the database, not just the server.

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"

Load specified library (-l) 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.

Use ODBC to connect (-m) Establish a connection using ODBC. By default, dbping attempts a connection using the embedded SQL interface.

Report connection properties (-pc) 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.

Report database properties (-pd) 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.

Report database server properties (-ps) 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.

Log output messages to file (-o) Write output messages to the named file.

Operate quietly (-q) If dbping fails, a message always appears. If succeeds, no message appears if -q is specified.

Display debugging information (-z) 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.