8. Installing and Starting HammerDB on Linux

To install HammerDB on Linux you have the option of using the .rpm file on Red Hat .deb file on Ubuntu or a tar.gz file. Note that the .rpm and .deb files will install all dependencies for full HammerDB functionality including an X windows display server if one is not already installed. If you would prefer

8.1. Install and Uninstall Red Hat .rpm file

To install the .rpm file for your operating system, use the following command.

[root@localhost Downloads]# rpm -ivh ./hammerdb-5.0-1.el9.x86_64.rpm
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:hammerdb-5.0-1.el9               ################################# [100%]

This will install HammerDB into the /opt directory.

[root@localhost HammerDB-5.0]# pwd
/opt/HammerDB-5.0

By default ownership is to the root user.

root@localhost HammerDB-5.0]# ls -l
total 31124
drwxr-xr-x. 2 root root       19 Apr  9 14:28 agent
drwxr-xr-x. 3 root root     4096 Apr  9 14:28 config
-rwxr-xr-x. 1 root root 12819442 Mar 24 14:18 hammerdb
-rwxr-xr-x. 1 root root 11022274 Mar 24 14:18 hammerdbcli
-rwxr-xr-x. 1 root root  7981127 Mar 24 14:18 hammerdbws
-rw-r--r--. 1 root root    35149 Mar 24 14:18 LICENSE
drwxr-xr-x. 3 root root       24 Mar 24 14:18 pylib
-rw-r--r--. 1 root root      518 Mar 24 14:18 README.md
drwxr-xr-x. 4 root root       31 Apr  9 14:28 scripts

You can change the ownership to any OS user.

[root@localhost opt]# chown -R redhat:redhat HammerDB-5.0/
[root@localhost opt]# ls -l HammerDB-5.0/
total 31124
drwxr-xr-x. 2 redhat redhat       19 Apr  9 14:36 agent
drwxr-xr-x. 3 redhat redhat     4096 Apr  9 14:36 config
-rwxr-xr-x. 1 redhat redhat 12819442 Mar 24 14:18 hammerdb
-rwxr-xr-x. 1 redhat redhat 11022274 Mar 24 14:18 hammerdbcli
-rwxr-xr-x. 1 redhat redhat  7981127 Mar 24 14:18 hammerdbws
-rw-r--r--. 1 redhat redhat    35149 Mar 24 14:18 LICENSE
drwxr-xr-x. 3 redhat redhat       24 Apr  9 14:36 pylib
-rw-r--r--. 1 redhat redhat      518 Mar 24 14:18 README.md
drwxr-xr-x. 4 redhat redhat       31 Apr  9 14:36 scripts

To fully uninstall HammerDB use the following command.

[root@localhost Downloads]# rpm -e --nodeps --allmatches --noscripts hammerdb

You can also remove the .db and .DB persistent configuration database files that are by default stored in the /tmp directory or where you have defined the TMP environment variable location.

8.2. Install and Uninstall Ubuntu .deb file

for Ubuntu use the apt-get command to install HammerDB and its dependencies.

ubuntu@ubuntu24:~$ sudo apt-get install -f ./hammerdb_5.0-1.ubu24.amd64.deb
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'hammerdb' instead of './hammerdb_5.0-1.ubu24.amd64.deb'
The following additional packages will be installed:
  libmariadb3 libpq5 mariadb-common mysql-common
The following NEW packages will be installed:
  hammerdb libmariadb3 libpq5 mariadb-common mysql-common
0 upgraded, 5 newly installed, 0 to remove and 317 not upgraded.
Need to get 0 B/34.3 MB of archives.
After this operation, 45.3 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y

To uninstall use apt-get remove.

ubuntu@ubuntu24:~/HammerDB-5.0$ sudo apt-get remove hammerdb
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libmariadb3 libpq5 mariadb-common mysql-common
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  hammerdb
0 upgraded, 0 newly installed, 1 to remove and 317 not upgraded.
After this operation, 44.2 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 225157 files and directories currently installed.)
Removing hammerdb (5.0-1) ...

You can also remove the .db and .DB persistent configuration database files that are by default stored in the /tmp directory or where you have defined the TMP environment variable location.

8.3. Install and Uninstall the Tar.gz File

As an alternative to the .rpm or .deb files you can install the same files from the equivalent tar.gz but will need to manage the dependencies manually. Run the following command to untar the correct package for your release.

tar -zxvf HammerDB-5.0-Prod-RHEL9.tar.gz

To delete the installation, remove the HammerDB-5.0 directory.

rm -rf HammerDB-5.0

You can also remove the .db and .DB persistent configuration database files that are by default stored in the /tmp directory or where you have defined the TMP environment variable location.

8.4. Starting HammerDB

To start HammerDB change to the HammerDB directory and run locally as follows.

./hammerdb