Navigation:  Command Line Applications >

CheckDB

Top  Previous  Next

CheckDB verifies a database connection through ODBC to ensure that a connection to a database can be established. You can optionally also run a single SQL statement after a successful connection has been established. A connection can be specified either through a DSN (Data Source Name) or a connection string. The output from CheckDB can either be displayed in the command line or logged to the event log.

 

With CheckDB, you can verify that:

 

a database server is available
the database specified in the DSN / connection string is online
the specified user has permission to log into the database server and database
the optionally specified SQL statement executed successfully

 

alert_or_warning_1_24_n_g

As with all ODBC-based utilities, you will need to ensure that the necessary ODBC drivers are installed on the machine from which you run this utility. Non-Windows platforms also need the respective ODBC framework (see "Prerequisites" below) installed.

 

Return Code (%ERRORLEVEL%)

CheckDB returns 0 when no errors have been encountered, and returns 1 if an error (e.g. database is unavailable, SQL query cannot execute) was encountered. Use event logging (/le) for detailed troubleshooting information.

 

Files

checkdb(.exe)

 

Prerequisites

OS X: iODBC

Linux / FreeBSD: unixODBC

 

Supported Platforms

Windows (64-bit version available)

Linux

FreeBSD

OS X