Navigation:  Command Line Applications > CheckDB >

Usage

Top  Previous  Next

Command Line Parameters

 

checkdb <DSN|ConnectionString> /u <USER> /p <PASS> /q <SQLQUERY> /lc /le

 

DSN or Connection String

DSN or connection string to connect to

/u <USERNAME>

Username to connect as (DSN only)

/p <PASSWORD>

Password for USERNAME (DSN only)

/q <SQLQUERY>

SQL query to execute upon successful connection

/lc

Log all output to console

/le

Log all output to event log

 

alert_or_warning_1_24_n_g

When using a connection string, both username and password need to be specified inside the connection string, the /u and /p options cannot be used.

Examples

 

Example 1: Check whether the database defined in DSN EventSentry is available and log output to the console

checkdb EventSentry /u eventsentry_web /p !$^&3jdk3 /lc

 

Example 2: Check whether the database defined in the connection string is available and log output to the event log

checkdb "driver={SQL Server};server=mssqlserver;Network=DBMSSOCN;database=EventSentry;uid=eventsentry_svc;pwd=1234" /le

 

Example 3: Check whether the database defined in DSN EventSentry is available, verify that the table ESEventlogLog exists and log output to the console and event log

checkdb EventSentry /u eventsentry_web /p !$^&3jdk3 /q "select top 1 * from ESEventlogLog" /lc /le

 

 

Sample Output

 

C:\>checkdb SQLSERVER /u eventsentry_web /p password /q "select top 1 * from ESEventlogLog" /lc /le

---------------------------------------------------------------

CheckDB v1.0 by NETIKUS.NET ltd [ compiled on May  8 2008 ]

                                   (support@netikus.net)

---------------------------------------------------------------

Verify a database connection through ODBC, optionally execute SQL statement.

 

 

Connect  : OK

DB Type  : Microsoft SQL Server

Time     : 1 second(s)

SQL Query: select top 1 * from ESEventlogLog -> OK

 

CheckDB_EventLog_Screenshot

Example event from the event log