Installation and use of HammerDB (super detailed)

Table of Contents

?edit

1. Introduction to HammerDB

2. Installation of HammerDB

1. Download hammerdb installation package

2. Permission configuration and installation

3. View the installation directory

3. Configuration before installation

1. Start monitoring

2. Start the database

3. Create table space

1. Modify the temporary table space

2. Modify the undo table space

3. Create HammerDB user tablespace – tpcctab

4. Set non-archive mode

4. Create data

5. Pressure test


1. Introduction to HammerDB

HammerDB is an open source database load testing and benchmarking tool for data from Oracle, Microsoft SQL Server, IBM DB2, TimesTen, MySQL, MariaDB, PostgreSQL, Postgres Plus Advanced Server, and traditional SQL on Greenplum, Redis, Amazon Aurora and Redshift, and Hadoop .

It can simulate the TPC-C test model (a benchmark program for online transaction processing OLTP). It is mainly used to simulate a wholesaler’s cargo management environment. The test results are measured by the TPC-C throughput rate. The unit in the standard test model is tpmC (in In hammerdb, the unit of test results is tpm, not tpmC. tpm represents the number of transactions per minute. tpmC is the transaction unit of TPC-C).

You can also simulate the TPC-H test model (which is a benchmark program for online analysis and processing of OLAP). It is mainly used to simulate the transaction behavior between suppliers and buyers. The test results are measured by TPCH Power. This value is related to the data volume and transaction average. Time related, indicating the number of complex transactions that can be completed in one hour.

2. Installation of HammerDB

1. Download hammerdb installation package

Baidu network disk download:

Link: https://pan.baidu.com/s/1cSpdaktK9u8XizvVr7WDBQ?pwd=d0so
Extraction code: d0so

Link to download:

wget https://nchc.dl.sourceforge.net/project/hammerora/HammerDB/HammerDB-2.23/HammerDB-2.23-Linux-x86-64-Install

After downloading the installation package, upload it to /home/oracle

2. Permission configuration and installation

[root@master /root] chmod + x HammerDB-2.23-Linux-x86-64-Install


[root@master /root] ./HammerDB-2.23-Linux-x86-64-Install

This will install HammerDB on your computer. Continue? [n/Y] y
Where do you want to install HammerDB? [/usr/local/HammerDB-2.23] You can execute the directory here. If you want to default, just press Enter. I prefer to install it automatically. I define /home/oracle
Installing HammerDB...
Installing Program Files...
Installation complete. 

3. View the installation directory

The specific installation directory here is mainly the one defined above.

[root@master /root] cd /home/oracle/HammerDB-2.23/
[root@master /home/oracle/HammerDB-2.23] ll
total 1508
drwx------ 2 root 4096 Dec 5 15:51 agent
drwxr-xr-x 2 root 4096 Dec 5 15:51 bin
-rw-r--r-- 1 root 25744 Jun 16 19:24 ChangeLog
-rw-r--r-- 1 root 13789 Jun 8 01:05 config.xml
-rw-r--r-- 1 root 618 Dec 20 2016 COPYRIGHT
-rw-r--r-- 1 root 18009 Feb 16 2013 hammerdb.license
-rwxr--r-- 1 root 7050 Mar 14 2017 hammerdb.tcl
drwxr-xr-x 2 root 4096 Dec 5 15:51 hdb-components
drwxr-xr-x 2 root 4096 Dec 5 15:51 hdb-modules
drwxr-xr-x 2 root 4096 Dec 5 15:51 include
drwxr-xr-x 21 root 4096 Dec 5 15:51 lib
-rw-r--r-- 1 root 883 Mar 14 2017 readme
-rwxr-xr-x 1 root 1433874 Dec 5 15:51 uninstall

Modify /etc/selinux/config

vim /etc/selinux/config

SELINUX=disabled
# SELINUXTYPE= can take one of three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted

Restart the virtual machine

Use the oracle user to execute export DISPLAY=':1.0'

export DISPLAY=':1.0'

The installation is now complete.

3. Configuration before installation

1. Start monitoring

lsnrctl start

When there is no service in monitoring and the database cannot be connected

vim $ORACLE_HOME/network/admin/listener.ora
Add to
SID_LIST_LISTENER =
(SID_LIST =
  (SID_DESC =
  (GLOBAL_DBNAME = orcl)
  (SID_NAME = orcl)
  )
)

2. Start database

Enter database

sqlplus/as sysdba

Start database

startup

1. Modify temporary table space

ALTER TABLESPACE temp ADD TEMPFILE '/u01/app/oracle/oradata/orcl/temp02.dbf' SIZE 30G;

2. Modify the undo table space

ALTER TABLESPACE undotbs1 ADD DATAFILE '/u01/app/oracle/oradata/orcl/undotbs1.dbf' SIZE 30G;

3. Create HammerDB user table space – tpcctab

CREATE TABLESPACE tpcctab DATAFILE '/u01/app/oracle/oradata/orcl/tpcctab1.dbf' SIZE 30G;

4. Set non-archive mode

To set the Oracle database to non-archive mode, you need to perform the following steps:

1. First, confirm the current archiving mode of the database. You can view this by executing the following SQL statement:
“`
SELECT log_mode FROM v$database;
“`

2. If the current archive mode is “ARCHIVELOG”, you need to set it to “NOARCHIVELOG” mode first. Execute the following SQL statement to modify the archive mode:
“`
SHUTDOWN IMMEDIATE; (This step is slower to execute)

startup MOUNT;

ALTER DATABASE ARCHIVELOG OFF;

ALTER DATABASE OPEN;
“`

3. At this point, the database has been successfully set to non-archive mode. You can confirm whether the setting takes effect by executing the following SQL statement:
“`
SELECT log_mode FROM v$database;
“`

Please note that after setting the database to non-archive mode, you will not be able to perform database full recovery and point recovery operations, so before performing this operation, please ensure that you have backed up all important data.

Four. Create data

Enter HammerDB

./hammerdb

Then start creating data and wait.

If an error occurs in the middle, it may be that the database service or monitoring is not turned on. If an error occurs after executing it, it may be that the same user exists (he usually says it is a brace error or something like a syntax error)

At this time, you need to go into the database and delete the user.

Execute in sql state:

drop user tpcc cascade;

5. Stress Test

Create user and run

Then wait for the graph to stabilize and then record the value, and the stress test ends.

Tagged , , , , ,