HammerDB
HammerDB is an open source benchmark utility for
database systems. In the beginning, this tool went by the name
HammerOra but it can now be used on other database platforms as
well, hence the more generic name. HammerDB can be found at
http://hammerora.sourceforge.net for the download files and the
documentation. Installation is as easy as using an unzip utility to
extract the contents.
TPC-C Benchmark
The easiest way to see HammerDB in action is to
run the Transaction Performance
Processing Council TPC-C benchmark, which
simulates Online Transaction Processing (OLTP) order entry system,
very similar to the Swingbench OE test. In the HammerDB unzip
directory, run the
hammerdb.tcl utility to start the program. After the program
starts, expand the TPC-C folder under the Oracle heading, similar to
the following.
Figure 10.27 HammerDB TPC-C Options
Before the test can begin, the schema for the
benchmark tool needs to be created. The database administrator can
double click on the Options under the Schema Build section. This
will bring up a dialog box to define the service name, dba user and
password, the schema owner (tpcc) user and password, and a
tablespace name, as seen in the next example. Note that the
tablespace must previously exist which means the database
administrator must manually pre-create it.
Figure 10.28 HammerDB TPC-C Build Options
Press OK to accept the build options. The
database administrator will then need to double click on the Build
item to begin the schema creation. Confirmation is needed before
continuing, as seen below.
Figure 10.29 HammerDB TPC-C Build
Confirmation
The Virtual User Output window shows the build
progress.
Figure 10.30 HammerDB TPC-C Build Creation
The schema creation will be complete when pane
below the Virtual User Output window shows a value of ?1? under the
Complete column and the Status column shows a green check mark.
Figure 10.31 HammerDB TPC-C Build Complete
When complete, the database administrator will
need to close the virtual user connection by pressing the red stop
light icon in the toolbar, tenth icon from the left in the image
below.
Figure 10.32 HammerDB Toolbar
Now that the test schema has been created,
HammerDB needs a script to drive the benchmark test. The database
administrator needs to open the Driver Script folder, as seen below.
Figure 10.33 HammerDB TPC-C Driver Script
Double-clicking on the Options item lets the
database administrator configure the options used to direct the
test. For now, the default options are sufficient. Notice that the
Driver Options section denotes a total number of transactions per
user that will be executed.
Figure 10.34 HammerDB TPC-C Driver Options
Next, the database administrator double-clicks on
the Load item to place the driver script in the Script Editor
window, as seen below.
Figure 10.35 HammerDB TPC-C Driver Script
At this point, the database administrator has
created the database schema and created the script to define the
benchmark tests. Next, the virtual users need to be defined. The
database administrator needs to open the Virtual Users folder,
similar to the following.
Figure 10.36 HammerDB TPC-C Virtual Users
Double-clicking on the Options item brings up a
dialog box where the database administrator can define the number of
virtual users to participate in the test. In the example below,
forty users have been defined.
Figure 10.37 HammerDB TPC-C Virtual User
Options
Next, the database administrator double-clicks on
the Create item to create the virtual users. The virtual users will
be shown in the tool as shown below. They will be idle.
Figure 10.38 HammerDB TPC-C Virtual Users
To begin the test, the database administrator
will press the Run Virtual Users button (green arrow), which is
immediately to the right of the Destroy Virtual Users button used
after creating the schema. The Virtual User Output pane will show
the work being done by the users.
Figure 10.39 HammerDB TPC-C Virtual Users
Running
To see the performance of the benchmark test,
click on the Transaction Counter icon, two spots to the right of the
Run Virtual Users icon in the toolbar. The Transaction Counter pane
can be selected. Run the test again to see the graph in action,
similar to the following.
Figure 10.40 HammerDB TPC-C Transaction
Counter
Unfortunately, other than the Transaction Counter
graph, HammerDB does not provide metrics for the database
administrator to use, which is the entire point of a benchmark
anyway. The Transaction Counter graph provides a pretty picture to
look at but for real use, the database administrator will want to
leverage the AWR driver script in the next section.