1. Start the CLI

To start the command line in interactive mode on Linux run:

hammerdb>steve@CRANE:~/HammerDB-3.0$ ./hammerdbcli 
HammerDB CLI v3.0
Copyright (C) 2003-2018 Steve Shaw
Type "help" for a list of commands
The xml is well-formed, applying configuration
hammerdb>

On Windows double-click hammerdbcli.bat

Figure 8.1. hammerdbcli.bat

hammerdbcli.bat

This will display a console command Window. On Windows this console command window has been designed to run with white text on a black background. If necessary the colours can be changed using the Windows COLOR command.

Figure 8.2. CLI Windows

CLI Windows

It is also possible to run a script directly from the command line by providing the auto argument preceding the name of a script to tun. For example the following script is named buildcli.tcl on a Windows based system. Note that the line "vwait forever" has been added to the end of the script to be run. This is required to enter the event loop for correct processing of the script when being called in this manner.

#!/bin/tclsh
puts "SETTING CONFIGURATION"
global complete
proc wait_to_complete {} {
global complete 
set complete [vucomplete]
if {!$complete} { after 5000 wait_to_complete } else { exit }
}
dbset db mssqls
diset connection mssqls_server (local)\\SQLDEVELOP
diset tpcc mssqls_count_ware 2
diset tpcc mssqls_num_vu 2
print dict
buildschema
wait_to_complete
vwait forever

By following hammerdbcli.bat (or hammerdbcli on Linux) by the auto argument and the name of the script,

Figure 8.3. Run buildcli.tcl

CLI WindowsRun buildcli.tcl

The script is then run directly without interaction.

Figure 8.4. buildcli.tcl running

CLI Windowsbuildcli.tcl running