### Start HammerDB Web Service (CLI) Source: https://context7.com/tpc-council/hammerdb/llms.txt Starts the HammerDB web service in the background. Ensure HammerDB is installed and accessible in your PATH. ```bash ./hammerdbws nowait ``` -------------------------------- ### Configure and Start CPU Metrics Agent Source: https://context7.com/tpc-council/hammerdb/llms.txt Set up and initiate the HammerDB CPU metrics agent for monitoring. ```tcl # Configure metrics agent metset agent_hostname localhost metset agent_id 0 # Start CPU metrics collection metstart # Check metrics status metstatus # Stop metrics collection metstop ``` -------------------------------- ### Run HammerDB Container (Interactive Bash) Source: https://github.com/tpc-council/hammerdb/blob/master/Docker/postgres/Readme.md Create and start an interactive container named 'hammerdb-postgres' from the 'hammerdb:postgres' image. ```bash docker run -it --name hammerdb-postgres hammerdb:postgres bash ``` -------------------------------- ### Verify Database Libraries Source: https://context7.com/tpc-council/hammerdb/llms.txt Use `librarycheck` to ensure all necessary database client libraries are installed and accessible. ```tcl # Check all database libraries librarycheck # Output example: # Checking database library for Oracle # Success ... loaded library Oratcl for Oracle # Checking database library for MSSQLServer # Success ... loaded library tdbc::odbc for MSSQLServer # Checking database library for PostgreSQL # Success ... loaded library Pgtcl for PostgreSQL ``` -------------------------------- ### Run HammerDB Container with Host Networking Source: https://context7.com/tpc-council/hammerdb/llms.txt Start a HammerDB Docker container using host networking for direct access. ```bash # Run HammerDB container with host networking docker run --network=host -it --name hammerdb tpcorg/hammerdb bash ``` -------------------------------- ### librarycheck - Verify Database Libraries Source: https://context7.com/tpc-council/hammerdb/llms.txt Verify that all required database client libraries are properly installed using the `librarycheck` command. ```APIDOC ## librarycheck - Verify Database Libraries ### Description Tests if required database client libraries are installed. ### Command - `librarycheck`: Check all database libraries. ``` -------------------------------- ### Run HammerDB MySQL Container Source: https://github.com/tpc-council/hammerdb/blob/master/Docker/mysql/Readme.md Create and start a HammerDB container named 'hammerdb-mysql' from the 'hammerdb:mysql' image. This command runs in interactive mode and attaches a pseudo-TTY. ```bash docker run -it --name hammerdb-mysql hammerdb:mysql bash ``` -------------------------------- ### Run HammerDB Container with GUI Support Source: https://github.com/tpc-council/hammerdb/blob/master/Docker/Readme.md Starts a HammerDB container with X11 forwarding enabled by mounting the Xauthority file and setting the DISPLAY environment variable. It also uses host networking. ```bash docker run -it --rm -v ~/.Xauthority:/root/.Xauthority -e DISPLAY=$DISPLAY --network=host --name hammerdb hammerdb bash ``` -------------------------------- ### Start HammerDB MSSQL Container Source: https://github.com/tpc-council/hammerdb/blob/master/Docker/mssqls/Readme.md Starts an interactive bash session within a HammerDB container for Microsoft SQL Server. This is for basic container execution. ```bash docker run -it --name hammerdb-mssqls hammerdb:mssqls bash ``` -------------------------------- ### Start/Stop Web Service Source: https://context7.com/tpc-council/hammerdb/llms.txt Control the HammerDB web service. Ensure the port is set before starting. ```tcl # Set web service port wsport 8080 # Start web service wsstart # Check web service status wsstatus # Stop web service wsstop ``` -------------------------------- ### Start HammerDB MSSQL Container with Host Network Source: https://github.com/tpc-council/hammerdb/blob/master/Docker/mssqls/Readme.md Starts an interactive bash session within a HammerDB container for Microsoft SQL Server using host networking. This is necessary for remote database communication. ```bash docker run --network=host -it --name hammerdb-mssqls hammerdb:mssqls bash ``` -------------------------------- ### Run HammerDB MariaDB Container Source: https://github.com/tpc-council/hammerdb/blob/master/Docker/maria/Readme.md Create and start an interactive container named 'hammerdb-maria' from the 'hammerdb:maria' image. This command opens a bash shell inside the container. ```bash docker run -it --name hammerdb-maria hammerdb:maria bash ``` -------------------------------- ### Run HammerDB Container with Host Network Source: https://github.com/tpc-council/hammerdb/blob/master/Docker/postgres/Readme.md Start an interactive HammerDB container using the host's network stack, which is useful for communicating with remote databases. ```bash docker run --network=host -it --name hammerdb-postgres hammerdb:postgres bash ``` -------------------------------- ### Run HammerDB Oracle Container with Host Network Source: https://github.com/tpc-council/hammerdb/blob/master/Docker/oracle/Readme.md Creates and starts an interactive HammerDB Oracle container using the host's network stack. This is useful for connecting to remote databases. ```bash docker run --network=host -it --name hammerdb-oracle hammerdb:oracle bash ``` -------------------------------- ### Start CPU Metrics Agent on Specific Port Source: https://context7.com/tpc-council/hammerdb/llms.txt Run the HammerDB CPU metrics agent on a specified port, typically on the database server. ```bash # Start agent on specific port (run on database server) ./agent/agent 8181 # Agent accepts connections from HammerDB client # and reports CPU utilization using mpstat (Linux) or twapi (Windows) ``` -------------------------------- ### Start/Stop Web Service Source: https://context7.com/tpc-council/hammerdb/llms.txt Commands to manage the HammerDB web service, including setting the port, starting, checking status, and stopping the service. ```APIDOC ## Start/Stop Web Service ### Description Commands to manage the HammerDB web service. ### Commands - `wsport `: Set the web service port. - `wsstart`: Start the web service. - `wsstatus`: Check the web service status. - `wsstop`: Stop the web service. ``` -------------------------------- ### Pull HammerDB Oracle Docker Image Source: https://github.com/tpc-council/hammerdb/blob/master/Docker/oracle/Readme.md Pulls the pre-built HammerDB Oracle Docker image from DockerHub. This is the simplest way to get started. ```bash docker pull tpcorg/hammerdb:oracle ``` ```bash docker tag tpcorg/hammerdb:oracle hammerdb:oracle ``` -------------------------------- ### Run HammerDB Oracle Container Source: https://github.com/tpc-council/hammerdb/blob/master/Docker/oracle/Readme.md Creates and starts an interactive HammerDB Oracle container named 'hammerdb-oracle' from the 'hammerdb:oracle' image. This command opens a bash shell inside the container. ```bash docker run -it --name hammerdb-oracle hammerdb:oracle bash ``` -------------------------------- ### Set DISPLAY Environment Variable for GUI Source: https://github.com/tpc-council/hammerdb/blob/master/Docker/Readme.md Sets the DISPLAY environment variable to enable X11 forwarding for the HammerDB GUI interface when running in a Docker container. This example is for Ubuntu. ```bash export DISPLAY=localhost:10.0 ``` -------------------------------- ### Get Job Details via REST API Source: https://context7.com/tpc-council/hammerdb/llms.txt Retrieve specific details for a given job ID using the HammerDB REST API. ```bash # Get job details curl "http://localhost:8080/jobs?jobid=YOUR_JOB_ID" ``` ```bash # Get benchmark type for job curl "http://localhost:8080/jobs?jobid=YOUR_JOB_ID&bm" ``` ```bash # Get database type for job curl "http://localhost:8080/jobs?jobid=YOUR_JOB_ID&db" ``` ```bash # Get configuration dictionary curl "http://localhost:8080/jobs?jobid=YOUR_JOB_ID&dict" ``` ```bash # Get job status curl "http://localhost:8080/jobs?jobid=YOUR_JOB_ID&status" ``` ```bash # Get benchmark result summary curl "http://localhost:8080/jobs?jobid=YOUR_JOB_ID&result" ``` ```bash # Get raw result data curl "http://localhost:8080/jobs?jobid=YOUR_JOB_ID&resultdata" ``` ```bash # Get job timestamp curl "http://localhost:8080/jobs?jobid=YOUR_JOB_ID×tamp" ``` ```bash # Get transaction count curl "http://localhost:8080/jobs?jobid=YOUR_JOB_ID&tcount" ``` ```bash # Get timing summary curl "http://localhost:8080/jobs?jobid=YOUR_JOB_ID&timing" ``` ```bash # Get timing for specific virtual user curl "http://localhost:8080/jobs?jobid=YOUR_JOB_ID&timing&vuid=1" ``` ```bash # Get output for specific virtual user curl "http://localhost:8080/jobs?jobid=YOUR_JOB_ID&vu=1" ``` ```bash # Delete a job curl "http://localhost:8080/jobs?jobid=YOUR_JOB_ID&delete" ``` -------------------------------- ### Pull HammerDB Cloudtk Docker Image Source: https://github.com/tpc-council/hammerdb/blob/master/Docker/cloudtk/Readme.md Pulls the pre-built HammerDB client image with Cloudtk support from DockerHub. This is a convenient way to start using the image without building it yourself. ```bash docker pull tpcorg/hammerdb:cloudtk docker tag tpcorg/hammerdb:cloudtk hammerdb:cloudtk ``` -------------------------------- ### Configure and Run TPC-C Benchmark (Tcl) Source: https://context7.com/tpc-council/hammerdb/llms.txt Sets up PostgreSQL TPC-C benchmark parameters, loads the script, and initiates the test. Ensure TMP environment variable is set for temporary file storage. ```tcl set tmpdir $::env(TMP) puts "SETTING CONFIGURATION" dbset db pg dbset bm TPC-C diset connection pg_host localhost diset connection pg_port 5432 diset connection pg_sslmode prefer diset tpcc pg_superuser postgres diset tpcc pg_superuserpass postgres diset tpcc pg_defaultdbase postgres diset tpcc pg_user tpcc diset tpcc pg_pass tpcc diset tpcc pg_dbase tpcc diset tpcc pg_driver timed diset tpcc pg_total_iterations 10000000 diset tpcc pg_rampup 2 diset tpcc pg_duration 5 diset tpcc pg_vacuum true diset tpcc pg_timeprofile true diset tpcc pg_allwarehouse true loadscript puts "TEST STARTED" vuset vu vcpu vucreate tcstart tcstatus set jobid [vurun] vudestroy tcstop puts "TEST COMPLETE" # Save job ID for results retrieval set of [open $tmpdir/pg_tprocc w] puts $of $jobid close $of ``` -------------------------------- ### Configure Transaction Counter (Tcl) Source: https://context7.com/tpc-council/hammerdb/llms.txt Sets up parameters for the real-time transaction counter. Ensure logging and timestamping are configured as needed for monitoring. ```tcl # Configure transaction counter tcset refreshrate 10 # Refresh every 10 seconds tcset logtotemp 1 # Log to temp directory tcset unique 1 # Unique log file names tcset timestamps 1 # Include timestamps # Start transaction counter tcstart # Check transaction counter status tcstatus # Stop transaction counter tcstop ``` -------------------------------- ### Run HammerDB Container with GUI Support Source: https://context7.com/tpc-council/hammerdb/llms.txt Launch a HammerDB Docker container with X11 forwarding enabled for GUI access. ```bash # Run with GUI support (X11 forwarding) export DISPLAY=localhost:10.0 xhost+ docker run -it --rm \ -v ~/.Xauthority:/root/.Xauthority \ -e DISPLAY=$DISPLAY \ --network=host \ --name hammerdb \ tpcorg/hammerdb bash ``` -------------------------------- ### Build HammerDB MariaDB Docker Image Source: https://github.com/tpc-council/hammerdb/blob/master/Docker/maria/Readme.md Navigate to the directory containing the Dockerfile and execute this command to build the HammerDB client Docker image for MariaDB. ```bash docker build -t hammerdb:maria . ``` -------------------------------- ### Configure Generic Settings Source: https://context7.com/tpc-council/hammerdb/llms.txt Use the `giset` command to configure non-database-specific settings in HammerDB. ```tcl # Configure keepalive margin for CLI giset commandline keepalive_margin 60 # View all generic settings print generic ``` -------------------------------- ### Execute Benchmark Test with vurun Source: https://context7.com/tpc-council/hammerdb/llms.txt The `vurun` command executes the configured benchmark test using virtual users. It automatically creates virtual users if they do not already exist. ```tcl #!/bin/tclsh ``` -------------------------------- ### Display Configuration (Tcl) Source: https://context7.com/tpc-council/hammerdb/llms.txt Prints various configuration and status details of HammerDB, including database, benchmark, virtual user, and transaction counter settings. ```tcl # Display current database print db # Display current benchmark print bm # Display database-specific dictionary settings print dict # Display generic settings print generic # Display loaded script print script # Display virtual user configuration print vuconf # Display number of created virtual users print vucreated # Display virtual user status print vustatus # Display transaction counter configuration print tcconf # Display data generation settings print datagen ``` -------------------------------- ### Build Custom HammerDB Docker Image Source: https://context7.com/tpc-council/hammerdb/llms.txt Create a custom HammerDB Docker image from a Dockerfile. ```bash # Build custom image from Dockerfile cd Docker docker build -t hammerdb . ``` -------------------------------- ### Build HammerDB Oracle Docker Image Source: https://github.com/tpc-council/hammerdb/blob/master/Docker/oracle/Readme.md Builds a HammerDB Oracle Docker image from the local Dockerfile. Navigate to the directory containing the Dockerfile before running this command. ```bash docker build -t hammerdb:oracle . ``` -------------------------------- ### Configure and Run TPC-C Benchmark (Python) Source: https://context7.com/tpc-council/hammerdb/llms.txt Configures and executes a PostgreSQL TPC-C benchmark using HammerDB's Python CLI. Requires the TMP environment variable to be set for temporary file operations. ```python import os tmpdir = os.getenv('TMP') print("SETTING CONFIGURATION") dbset('db', 'pg') dbset('bm', 'TPC-C') diset('connection', 'pg_host', 'localhost') diset('connection', 'pg_port', '5432') diset('connection', 'pg_sslmode', 'prefer') diset('tpcc', 'pg_superuser', 'postgres') diset('tpcc', 'pg_superuserpass', 'postgres') diset('tpcc', 'pg_defaultdbase', 'postgres') diset('tpcc', 'pg_user', 'tpcc') diset('tpcc', 'pg_pass', 'tpcc') diset('tpcc', 'pg_dbase', 'tpcc') diset('tpcc', 'pg_driver', 'timed') diset('tpcc', 'pg_total_iterations', '10000000') diset('tpcc', 'pg_rampup', '2') diset('tpcc', 'pg_duration', '5') diset('tpcc', 'pg_allwarehouse', 'true') diset('tpcc', 'pg_timeprofile', 'true') diset('tpcc', 'pg_vacuum', 'true') loadscript() print("TEST STARTED") vuset('vu', 'vcpu') vucreate() tcstart() tcstatus() jobid = tclpy.eval('vurun') vudestroy() tcstop() print("TEST COMPLETE") # Save results file_path = os.path.join(tmpdir, "pg_tprocc") with open(file_path, "w") as fd: fd.write(jobid) ``` -------------------------------- ### Docker Deployment Source: https://context7.com/tpc-council/hammerdb/llms.txt Instructions for deploying HammerDB using Docker, including pulling official images and running containers. ```APIDOC ## Docker Deployment ### Description Deploy HammerDB using official Docker images. ### Commands - `docker pull tpcorg/hammerdb`: Pull the official HammerDB image. - `docker pull tpcorg/hammerdb:`: Pull database-specific images (e.g., `postgres`, `mysql`). - `docker run --network=host -it --name hammerdb tpcorg/hammerdb bash`: Run HammerDB container with host networking. - `export DISPLAY=localhost:10.0; xhost+; docker run -it --rm -v ~/.Xauthority:/root/.Xauthority -e DISPLAY=$DISPLAY --network=host --name hammerdb tpcorg/hammerdb bash`: Run with GUI support (X11 forwarding). - `cd Docker; docker build -t hammerdb .`: Build custom image from Dockerfile. ``` -------------------------------- ### Build HammerDB Docker Image Source: https://github.com/tpc-council/hammerdb/blob/master/Docker/Readme.md Builds a HammerDB client Docker image from a Dockerfile. Ensure you are in the directory containing the Dockerfile. ```bash docker build -t hammerdb . ``` -------------------------------- ### Build HammerDB PostgreSQL Docker Image Source: https://github.com/tpc-council/hammerdb/blob/master/Docker/postgres/Readme.md Build the HammerDB Docker image locally from the Dockerfile. Ensure you are in the directory containing the Dockerfile. ```bash docker build -t hammerdb:postgres . ``` -------------------------------- ### Build HammerDB Cloudtk Docker Image Source: https://github.com/tpc-council/hammerdb/blob/master/Docker/cloudtk/Readme.md Builds a custom HammerDB client Docker image with Cloudtk. Navigate to the directory containing the Dockerfile before running this command. ```bash docker build -t hammerdb:cloudtk . ``` -------------------------------- ### Build HammerDB MySQL Docker Image Source: https://github.com/tpc-council/hammerdb/blob/master/Docker/mysql/Readme.md Build the HammerDB client Docker image for MySQL from the Dockerfile. Ensure you are in the directory containing the Dockerfile. ```bash docker build -t hammerdb:mysql . ``` -------------------------------- ### Build HammerDB MSSQL Docker Image Source: https://github.com/tpc-council/hammerdb/blob/master/Docker/mssqls/Readme.md Builds a HammerDB Docker image for Microsoft SQL Server from the local Dockerfile. Ensure you are in the directory containing the Dockerfile. ```bash docker build -t hammerdb:mssqls . ``` -------------------------------- ### Configure Schema and Test Settings with diset Source: https://context7.com/tpc-council/hammerdb/llms.txt Use `diset` to set database-specific parameters for schema building and test execution. This includes connection details and workload configurations. ```tcl # PostgreSQL TPC-C connection settings diset connection pg_host localhost diset connection pg_port 5432 diset connection pg_sslmode prefer # Schema build settings diset tpcc pg_count_ware 100 # Number of warehouses diset tpcc pg_num_vu 10 # Virtual users for schema build diset tpcc pg_superuser postgres diset tpcc pg_superuserpass postgres diset tpcc pg_defaultdbase postgres diset tpcc pg_user tpcc diset tpcc pg_pass tpcc diset tpcc pg_dbase tpcc diset tpcc pg_storedprocs true diset tpcc pg_partition true # Driver settings for timed test diset tpcc pg_driver timed diset tpcc pg_rampup 2 # Ramp-up time in minutes diset tpcc pg_duration 5 # Test duration in minutes diset tpcc pg_total_iterations 10000000 diset tpcc pg_allwarehouse true diset tpcc pg_timeprofile true diset tpcc pg_vacuum true ``` -------------------------------- ### Command Line Execution Source: https://context7.com/tpc-council/hammerdb/llms.txt Instructions for executing HammerDB scripts automatically via the command line, useful for CI/CD integration. ```APIDOC ## Command Line Execution ### Description Execute HammerDB scripts automatically via the command line. ### Commands - `./hammerdbcli`: Start Tcl CLI in interactive mode. - `./hammerdbcli tcl auto `: Auto-execute a Tcl script. - `./hammerdbcli python`: Start Python CLI in interactive mode. - `./hammerdbcli python auto `: Auto-execute a Python script. - `./hammerdbws start`: Start web service (blocks). ``` -------------------------------- ### Set Database and Benchmark Type with dbset Source: https://context7.com/tpc-council/hammerdb/llms.txt Use `dbset` to configure the target database and benchmark type. This is the initial step for any HammerDB test. ```tcl # Set database to PostgreSQL dbset db pg # Set benchmark to TPC-C (OLTP workload) dbset bm TPC-C # Set benchmark to TPC-H (OLAP workload) dbset bm TPC-H # Available database prefixes: # ora - Oracle Database # mssqls - Microsoft SQL Server # db2 - IBM Db2 # pg - PostgreSQL # mysql - MySQL # maria - MariaDB ``` -------------------------------- ### Run HammerDB Docker Container Source: https://github.com/tpc-council/hammerdb/blob/master/Docker/Readme.md Creates and runs an interactive HammerDB container named 'hammerdb' from the built image. Use bash to access the container's shell. ```bash docker run -it --name hammerdb hammerdb bash ``` -------------------------------- ### Configure Primary/Replica Mode Source: https://context7.com/tpc-council/hammerdb/llms.txt Switch HammerDB between Local, Primary, and Replica modes for distributed testing. ```tcl # Switch to Local mode (default) switchmode Local # Switch to Primary mode (coordinator) switchmode Primary # Switch to Replica mode (connect to Primary) switchmode Replica 1 primary_hostname # Distribute script to all connected Replicas distributescript # Run step workload across Primary and Replicas steprun ``` -------------------------------- ### Run HammerDB Cloudtk Container with Port Exposure Source: https://github.com/tpc-council/hammerdb/blob/master/Docker/cloudtk/Readme.md Creates and runs a container named 'hammerdb-cloudtk' from the 'hammerdb:cloudtk' image. Ports 8080, 8081, and 8082 are exposed for accessing the HammerDB application, its web service, and jobs respectively. ```bash docker run -p 8081:8081 -p 8082:8082 -p 8080:8080 --name hammerdb-cloudtk hammerdb:cloudtk ``` -------------------------------- ### Generic Settings Source: https://context7.com/tpc-council/hammerdb/llms.txt Configuration of generic, non-database-specific settings using the `giset` command. ```APIDOC ## Generic Settings ### Description Configure generic settings using the `giset` command. ### Commands - `giset commandline keepalive_margin `: Configure keepalive margin for CLI. - `print generic`: View all generic settings. ``` -------------------------------- ### Build Database Schema with buildschema Source: https://context7.com/tpc-council/hammerdb/llms.txt The `buildschema` command creates the TPC-C or TPC-H schema in the target database. This script demonstrates a complete PostgreSQL TPC-C schema build. ```tcl #!/bin/tclsh # Complete PostgreSQL TPC-C schema build script puts "SETTING CONFIGURATION" dbset db pg dbset bm TPC-C diset connection pg_host localhost diset connection pg_port 5432 diset connection pg_sslmode prefer # Calculate warehouses based on CPU count set vu [numberOfCPUs] set warehouse [expr {$vu * 5}] diset tpcc pg_count_ware $warehouse diset tpcc pg_num_vu $vu diset tpcc pg_superuser postgres diset tpcc pg_superuserpass postgres diset tpcc pg_defaultdbase postgres diset tpcc pg_user tpcc diset tpcc pg_pass tpcc diset tpcc pg_dbase tpcc diset tpcc pg_tspace pg_default diset tpcc pg_storedprocs true if { $warehouse >= 200 } { diset tpcc pg_partition true } else { diset tpcc pg_partition false } puts "SCHEMA BUILD STARTED" buildschema puts "SCHEMA BUILD COMPLETED" ``` -------------------------------- ### Manage Benchmark Jobs (Tcl) Source: https://context7.com/tpc-council/hammerdb/llms.txt Provides commands for listing, retrieving results, generating charts, deleting, and configuring the output format for benchmark jobs stored in HammerDB. ```tcl # List all jobs jobs # Get job list as text jobs joblist # Get results for all jobs jobs result # Get timestamps for all jobs jobs timestamp # Get specific job details jobs # Get specific job attributes jobs bm # Benchmark type jobs db # Database type jobs dict # Configuration dictionary jobs result # Benchmark result jobs status # Job status jobs timing # Timing summary jobs tcount # Transaction count # Generate charts jobs getchart result # Result chart jobs getchart timing # Timing chart jobs getchart tcount # Transaction count chart # Delete a job jobs delete # Configure job output format jobs format JSON # JSON output jobs format text # Text output # Disable/enable job storage jobs disable 1 # Disable jobs disable 0 # Enable ``` -------------------------------- ### Run HammerDB Cloudtk Container with Host Network Source: https://github.com/tpc-council/hammerdb/blob/master/Docker/cloudtk/Readme.md Runs a HammerDB client container using the host's network. This approach eliminates the need to explicitly expose container ports, simplifying network configuration for remote database communication. ```bash docker run --network=host -it --name hammerdb-cloudtk hammerdb:cloudtk bash ``` -------------------------------- ### CPU Metrics Agent Source: https://context7.com/tpc-council/hammerdb/llms.txt Information on the HammerDB metrics agent for monitoring CPU utilization during benchmarks. ```APIDOC ## CPU Metrics Agent ### Description Monitor CPU utilization during benchmarks using the HammerDB metrics agent. ### Tcl Commands - `metset agent_hostname `: Configure metrics agent hostname. - `metset agent_id `: Configure metrics agent ID. - `metstart`: Start CPU metrics collection. - `metstatus`: Check metrics status. - `metstop`: Stop metrics collection. ### Agent Execution - `./agent/agent `: Start agent on a specific port (run on database server). ``` -------------------------------- ### Run HammerDB MySQL Container with Host Network Source: https://github.com/tpc-council/hammerdb/blob/master/Docker/mysql/Readme.md Run the HammerDB container using the host's network stack. This is useful for communicating with remote databases. ```bash docker run --network=host -it --name hammerdb-mysql hammerdb:mysql bash ``` -------------------------------- ### Pull HammerDB MySQL Docker Image Source: https://github.com/tpc-council/hammerdb/blob/master/Docker/mysql/Readme.md Use this command to download the pre-built HammerDB Docker image with MySQL support from DockerHub. ```bash docker pull tpcorg/hammerdb:mysql ``` ```bash docker tag tpcorg/hammerdb:mysql hammerdb:mysql ``` -------------------------------- ### Execute HammerDB CLI Scripts Source: https://context7.com/tpc-council/hammerdb/llms.txt Automate HammerDB script execution via the command line for CI/CD pipelines. ```bash # Start Tcl CLI in interactive mode ./hammerdbcli # Auto-execute a Tcl script ./hammerdbcli tcl auto myscript.tcl # Start Python CLI in interactive mode ./hammerdbcli python # Auto-execute a Python script ./hammerdbcli python auto myscript.py # Start web service (blocks) ./hammerdbws start ``` -------------------------------- ### Pull HammerDB MariaDB Docker Image Source: https://github.com/tpc-council/hammerdb/blob/master/Docker/maria/Readme.md Use this command to download the pre-built HammerDB image with MariaDB support from DockerHub. ```bash docker pull tpcorg/hammerdb:maria docker tag tpcorg/hammerdb:maria hammerdb:maria ``` -------------------------------- ### Run HammerDB MariaDB Container with Host Network Source: https://github.com/tpc-council/hammerdb/blob/master/Docker/maria/Readme.md This command runs the HammerDB MariaDB container using the host's network stack, which is useful for communicating with a remote database. It also opens an interactive bash shell. ```bash docker run --network=host -it --name hammerdb-maria hammerdb:maria bash ``` -------------------------------- ### Execute HammerDB TPROC-C Script for MariaDB Source: https://github.com/tpc-council/hammerdb/blob/master/Docker/Readme.md Executes a shell script that orchestrates the build schema, run workload test, delete schema, and write results for the MariaDB TPROC-C workload. ```bash ./scripts/python/maria/tprocc/maria_tprocc_py.sh ``` -------------------------------- ### Pull Database-Specific HammerDB Docker Images Source: https://context7.com/tpc-council/hammerdb/llms.txt Download HammerDB Docker images pre-configured for specific databases. ```bash # Pull database-specific images docker pull tpcorg/hammerdb:postgres docker pull tpcorg/hammerdb:mysql docker pull tpcorg/hammerdb:maria docker pull tpcorg/hammerdb:oracle docker pull tpcorg/hammerdb:mssqls ``` -------------------------------- ### Pull HammerDB PostgreSQL Docker Image Source: https://github.com/tpc-council/hammerdb/blob/master/Docker/postgres/Readme.md Use this command to download the pre-built HammerDB Docker image for PostgreSQL from DockerHub. ```bash docker pull tpcorg/hammerdb:postgres ``` -------------------------------- ### List All Jobs via REST API Source: https://context7.com/tpc-council/hammerdb/llms.txt Use curl to list all jobs managed by the HammerDB web service. ```bash # List all jobs curl http://localhost:8080/jobs ``` -------------------------------- ### Configure Virtual User Behavior with vuset Source: https://context7.com/tpc-council/hammerdb/llms.txt Use `vuset` to configure virtual user settings such as count, delays, and logging. This command controls how concurrent users interact with the database. ```tcl # Set number of virtual users (vcpu auto-detects CPU count) vuset vu 16 vuset vu vcpu # Configure timing vuset delay 500 # User delay in milliseconds vuset repeat 500 # Repeat delay in milliseconds vuset iterations 1 # Number of iterations per user # Configure output and logging vuset showoutput 1 # Show virtual user output (0 or 1) vuset logtotemp 1 # Log output to temp directory vuset unique 1 # Use unique log file names vuset nobuff 0 # Disable log buffering vuset timestamps 1 # Include timestamps in logs ``` -------------------------------- ### Primary/Replica Mode Source: https://context7.com/tpc-council/hammerdb/llms.txt Configuration for distributed testing using Primary/Replica mode to coordinate multiple test clients. ```APIDOC ## Primary/Replica Mode ### Description Coordinate multiple test clients for distributed testing. ### Tcl Commands - `switchmode Local`: Switch to Local mode (default). - `switchmode Primary`: Switch to Primary mode (coordinator). - `switchmode Replica `: Switch to Replica mode and connect to Primary. - `distributescript`: Distribute script to all connected Replicas. - `steprun`: Run step workload across Primary and Replicas. ``` -------------------------------- ### Execute HammerDB Python Scripts for MariaDB Source: https://github.com/tpc-council/hammerdb/blob/master/Docker/Readme.md Executes individual Python scripts for building the schema, running the TPROC-C workload, deleting the schema, and writing results for MariaDB. ```bash ./scripts/python/maria/tprocc/maria_tprocc_buildschema.py ./scripts/python/maria/tprocc/maria_tprocc_run.py ./scripts/python/maria/tprocc/maria_tprocc_deleteschema.py ./scripts/python/maria/tprocc/maria_tprocc_result.py ``` -------------------------------- ### Tag HammerDB Docker Image Source: https://github.com/tpc-council/hammerdb/blob/master/Docker/postgres/Readme.md Alias the pulled HammerDB Docker image for easier reference. ```bash docker tag tpcorg/hammerdb:postgres hammerdb:postgres ``` -------------------------------- ### Pull HammerDB MSSQL Docker Image Source: https://github.com/tpc-council/hammerdb/blob/master/Docker/mssqls/Readme.md Pulls the pre-built HammerDB Docker image for Microsoft SQL Server from DockerHub. This is the first step before tagging or building. ```bash docker pull tpcorg/hammerdb:mssqls ``` -------------------------------- ### Pull Official HammerDB Docker Image Source: https://context7.com/tpc-council/hammerdb/llms.txt Download the official HammerDB Docker image for containerized deployments. ```bash # Pull the official HammerDB image docker pull tpcorg/hammerdb ``` -------------------------------- ### Validate Schema (Tcl) Source: https://context7.com/tpc-council/hammerdb/llms.txt Verifies the integrity of an existing benchmark schema for PostgreSQL TPC-C. Ensure database connection and TPC-C settings are correctly configured. ```tcl #!/bin/tclsh # Check schema consistency dbset db pg dbset bm TPC-C diset connection pg_host localhost diset connection pg_port 5432 diset tpcc pg_user tpcc diset tpcc pg_pass tpcc diset tpcc pg_dbase tpcc checkschema ``` -------------------------------- ### Tag HammerDB MSSQL Docker Image Source: https://github.com/tpc-council/hammerdb/blob/master/Docker/mssqls/Readme.md Tags the pulled HammerDB Docker image with a more convenient name. This is useful for consistent referencing. ```bash docker tag tpcorg/hammerdb:mssqls hammerdb:mssqls ``` -------------------------------- ### Pull Database-Specific HammerDB Images Source: https://github.com/tpc-council/hammerdb/blob/master/Docker/Readme.md Pulls pre-built HammerDB Docker images optimized for specific databases like MySQL, MariaDB, Oracle, PostgreSQL, and Microsoft SQL Server. ```bash docker pull tpcorg/hammerdb:mysql docker pull tpcorg/hammerdb:maria docker pull tpcorg/hammerdb:oracle docker pull tpcorg/hammerdb:postgres docker pull tpcorg/hammerdb:mssqls ``` -------------------------------- ### Jobs REST Endpoints Source: https://context7.com/tpc-council/hammerdb/llms.txt RESTful endpoints for managing and querying job information, including listing jobs, retrieving details, and checking status. ```APIDOC ## Jobs REST Endpoints ### Description RESTful endpoints for querying job information. ### Endpoints - **GET /jobs**: List all jobs. - **GET /jobs?jobid={YOUR_JOB_ID}**: Get job details. - **GET /jobs?jobid={YOUR_JOB_ID}&bm**: Get benchmark type for job. - **GET /jobs?jobid={YOUR_JOB_ID}&db**: Get database type for job. - **GET /jobs?jobid={YOUR_JOB_ID}&dict**: Get configuration dictionary. - **GET /jobs?jobid={YOUR_JOB_ID}&status**: Get job status. - **GET /jobs?jobid={YOUR_JOB_ID}&result**: Get benchmark result summary. - **GET /jobs?jobid={YOUR_JOB_ID}&resultdata**: Get raw result data. - **GET /jobs?jobid={YOUR_JOB_ID}×tamp**: Get job timestamp. - **GET /jobs?jobid={YOUR_JOB_ID}&tcount**: Get transaction count. - **GET /jobs?jobid={YOUR_JOB_ID}&timing**: Get timing summary. - **GET /jobs?jobid={YOUR_JOB_ID}&timing&vuid={VUID}**: Get timing for specific virtual user. - **GET /jobs?jobid={YOUR_JOB_ID}&vu={VUID}**: Get output for specific virtual user. - **GET /jobs?jobid={YOUR_JOB_ID}&delete**: Delete a job. ``` -------------------------------- ### Pull HammerDB Docker Image Source: https://github.com/tpc-council/hammerdb/blob/master/Docker/Readme.md Pulls the official HammerDB Docker image from DockerHub. This image can be tagged for easier reference. ```bash docker pull tpcorg/hammerdb docker tag tpcorg/hammerdb hammerdb ``` -------------------------------- ### Remove Schema (Tcl) Source: https://context7.com/tpc-council/hammerdb/llms.txt Removes the benchmark schema from the database for PostgreSQL TPC-C. Ensure database connection and superuser credentials are correctly set. ```tcl #!/bin/tclsh # Delete schema dbset db pg dbset bm TPC-C diset connection pg_host localhost diset connection pg_port 5432 diset tpcc pg_superuser postgres diset tpcc pg_superuserpass postgres diset tpcc pg_defaultdbase postgres deleteschema ``` -------------------------------- ### Disable Host Control for GUI Source: https://github.com/tpc-council/hammerdb/blob/master/Docker/Readme.md Disables host control access, which is a security measure required when enabling the HammerDB GUI interface with X11 forwarding. ```bash xhost+ ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.