2. CLI Commands

To learn CLI commands type "help".

HammerDB v3.0 CLI Help Index

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


The commands have the following functionality.

Table 8.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.
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
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.