2. CLI Commands

To learn CLI commands type "help".

HammerDB CLI v4.0
Copyright (C) 2003-2020 Steve Shaw
Type "help" for a list of commands
The xml is well-formed, applying configuration
HammerDB v4.0 CLI Help Index

Type "help command" for more details on specific commands below



The commands have the following functionality.

Table 9.1. CLI commands

buildschemaUsage: buildschemaRuns the schema build for the database and benchmark selected with dbset and variables selected with diset. Equivalent to the Build command in the graphical interface. Note that the buildschema command will assume the "yes" reply to the Yes or no prompt to proceed with the schema build. This is to prevent the stalling of CLI scripts during builds.
clearscriptUsage: clearscriptClears the script. Equivalent to the "Clear the Screen" button in the graphical interface.
customscriptUsage: customscript scriptname.tclLoad an external script. Equivalent to the "Open Existing File" button in the graphical interface.
datagenrunUsage: datagenrunRun Data Generation. Equivalent to the Generate option in the graphical interface.
dbsetUsage: dbset [db|bm] valueSets the database (db) or benchmark (bm). Equivalent to the Benchmark Menu in the graphical interface. Database value is set by the database prefix in the XML configuration.
dgsetUsage: dgset [vu|ware|directory]Set the Datagen options. Equivalent to the Datagen Options dialog in the graphical interface.
disetUsage: diset dict key valueSet the dictionary variables for the current database. Equivalent to the Schema Build and Driver Options windows in the graphical interface. Use "print dict" to see what these variables area and diset to change: Example: hammerdb>diset tpcc count_ware 10 Changed tpcc:count_ware from 1 to 10 for Oracle.
distributescriptUsage: distributescriptIn Master mode distributes the script loaded by Master to the connected Slaves.
librarycheckUsage: librarycheckAttempts to load the vendor provided 3rd party library for all databases and reports whether the attempt was successful.
loadscriptUsage: loadscriptLoad the script for the database and benchmark set with dbset and the dictionary variables set with diset. Use "print script" to see the script that is loaded. Equivalent to loading a Driver Script in the Script Editor window in the graphical interface.
printUsage: print [db|bm|dict|script|vuconf |vucreated|vustatus|datagen]prints the current configuration: db: database bm: benchmark dict: the dictionary for the current database ie all active variables script: the loaded script vuconf: the virtual user configuration vucreated: the number of virtual users created vustatus: the status of the virtual users datagen : the configuration to build when datagen is run
quitUsage: quit Shuts down the HammerDB CLI.Calls the exit command and terminates the CLI interface
runtimerruntimer - Usage: runtimer secondsHelper routine to run a timer in the main hammerdbcli thread to keep it busy for a period of time whilst the virtual users run a workload. The timer will return when vucomplete returns true or the timer reaches the seconds value. Usually followed by vudestroy.
switchmodeUsage: switchmode [mode] ?PrimaryID? ?PrimaryHostname?Changes the remote mode to Primary, Replica or Local. When Master it will report an id and a hostname. Equivalent to the Mode option in the graphical interface. Mode to switch to must be one of Local, Primary or Replica. If Mode is Replica then the ID and Hostname of the Primary to connect to must be given.
vucompleteUsage: vucompleteReturns "true" or "false" depending on whether all virtual users that started a workload have completed regardless of whether the status was "FINISH SUCCESS" or "FINISH FAILED".
vucreateUsage: vucreateCreate the virtual users. Equivalent to the Virtual User Create option in the graphical interface. Use "print vucreated" to see the number created, vustatus to see the status and vucomplete to see whether all active virtual users have finished the workload. A script must be loaded before virtual users can be created.
vudestroyUsage: vudestroyDestroy the virtual users. Equivalent to the Destroy Virtual Users button in the graphical interface that replaces the Create Virtual Users button after virtual user creation.
vurunUsage: vurunSend the loaded script to the created virtual users for execution. Equivalent to the Run command in the graphical interface.
vusetUsage: vuset [vu|delay|repeat|iterations|showoutput |logtotemp|unique|nobuff|timestampsConfigure the virtual user options. Equivalent to the Virtual User Options window in the graphical interface.
vustatusUsage: vustatusShow the status of virtual users. Status will be "WAIT IDLE" for virtual users that are created but not running a workload,"RUNNING" for virtual users that are running a workload, "FINISH SUCCESS" for virtual users that completed successfully or "FINISH FAILED" for virtual users that encountered an error.
waittocompleteUsage: waittocompleteHelper routine to enable the main hammerdbcli thread to keep it busy until vucomplete is detected. When vucomplete is detected exit is called causing all virtual users and the main hammerdblci thread to terminate. Often used when calling hammerdb from external scripting commands.