Hammerdb Commandline
Hammerdb Commandline
Hammerdb Commandline
This guide gives you an introduction to extending HammerDB autopilot mode with the command line a
feature introduced at HammerDB version 2.17. You should be familiar with running tests manually and
using Autopilot before using this functionality.
The solution contributed by Wes Vaske here has been fully implemented into HammerDB (with
modifications) at version 2.17 and therefore requires no additional code enhancements to run HammerDB
from CLI within a Windows or Linux environment. Although HammerDB still requires a graphical display to
run this functionality enables the user to interact with an external environment and script multiple test runs
whilst modifying the configuration.
HammerDB CLI
HammerDB can continue to be started in an interactive mode as previously by running hammerdb.tcl on
Linux and hammerdb.bat on Windows, however new functionality has been added on both Linux and
Windows to accept the keyword auto followed by the name of a script to run, this script must end in the
extension .tcl.
./hammerdb.tcl auto
Usage: hammerdb.tcl [ auto [ script_to_autoload.tcl ] ]
For example
./hammerdb.tcl auto newtpccscript.tcl
On doing so HammerDB will now load the script newtpccscript.tcl at startup and immediately enter the
autopilot sequence defined in config.xml. Upon completion HammerDB will exit. As detailed in the post
linked above this functionality enables the potential to run workloads such as the following with multiple
sequences of autopilot interspersed with a database refresh.
#!/bin/bash
set -e
SEQ1="4 6 8 10"
SEQ2="12 14 16 18"
SEQ3="20 22 24 26"
CONFIGFILE='/usr/local/hammerDB/config.xml'
RUNS=6
This solution coupled with autopilot enables considerable flexibility in defining and executing automated
database test workloads.