/
docs.xml
11947 lines (9878 loc) · 476 KB
/
docs.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8"?>
<book version="5.1" xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xila="http://www.w3.org/2001/XInclude/local-attributes"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:trans="http://docbook.org/ns/transclusion"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:m="http://www.w3.org/1998/Math/MathML"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:db="http://docbook.org/ns/docbook">
<info>
<title><inlinemediaobject>
<imageobject>
<imagedata fileref="docs/images/hammerDB-H-Logo-FB.png"/>
</imageobject>
</inlinemediaobject> HammerDB Documentation</title>
</info>
<chapter>
<title>Installation and Configuration</title>
<section>
<title>Release Notes</title>
<para>The following are the release notes for HammerDB v4.0.</para>
<section>
<title>Nomenclature Change</title>
<para>In the database.xml file and the User Interface the workload
names have changed to TPROC-C and TPROC-H. This is a nomenclature
change only to represent that the workloads are fair use
implementations derived from the TPC specifications and the
nomenclature does not change the functionality of the workload
compared to prior versions using the TPC-C and TPC-H
terminology.</para>
</section>
<section>
<title>Stored Procedure Refactoring and Performance</title>
<para>At version 4.0 the stored procedures for the Oracle and
PostgreSQL TPROC-C workloads have been refactored. This increases the
expected performance between versions and consequently the performance
from HammerDB v4.0 cannot be compared directly to the performance of
v3.3 or previous releases. Additionally for some workloads HammerDB
v4.0 changes the relationship between the NOPM and TPM metrics
compared to previous versions. As a result of the stored procedure
refactoring using bulk operations more work is processed per commit
and therefore in these cases the NOPM has increased whilst the TPM
remains the same. This indicates a real measure of increased
throughput by doing more work per database transaction and
consequently NOPM is now listed first as the primary metric in
reporting output. However as raised in <link
xlink:href="https://github.com/TPC-Council/HammerDB/issues/111">HammerDB
GitHub Issue #111</link> there may be cases where there is a
dependency on the wording of the HammerDB log. For this reason a
configuration option in the generic.xml file of first_result is given.
If this option is set to NOPM then the v4.0 format is used if set to
TPM then the output is compatible with v3.3.</para>
<programlisting><benchmark>
<rdbms>Oracle</rdbms>
<bm>TPC-C</bm>
<emphasis role="bold"><first_result>NOPM</first_result></emphasis>
</benchmark></programlisting>
</section>
<section>
<title>Redis Deprecated</title>
<para>The Redis workload has been deprecated and no longer features by
default in the main HammerDB menu. In particular as a single-threaded
database without support for stored procedures it was considered that
Redis was not suitable for running workloads derived from the TPC
specifications and could not reach similar levels of performance as
the relational databases currently supported. Redis can still be
enabled for unsupported use by uncommenting the Redis database entry
in database.xml.</para>
<programlisting><emphasis role="bold"><!--Redis deprecated, uncomment to enable as unsupported</emphasis>
<redis>
<name>Redis</name>
<description>Redis</description>
<prefix>redis</prefix>
<library>redis</library>
<workloads>{TPROC-C}</workloads>
<commands>redis</commands>
</redis>
<emphasis role="bold">--></emphasis></programlisting>
</section>
<section>
<title>Known Third-Party Driver Issues</title>
<para>HammerDB has a dependency on 3rd party driver libraries to
connect to the target databases. The following are known issues with
some of the 3rd party drivers that HammerDB uses.</para>
<section>
<title>Oracle on Windows: Oracle Bug 12733000 OCIStmtRelease crashes
or hangs if called after freeing the service context handle</title>
<para>If you are running HammerDB against Oracle on Windows there is
long established bug in Oracle that can cause application crashes
for multi-threaded applications on Windows.This bug can be
investigated on the My Oracle Support website with the following
reference. Bug 12733000 OCIStmtRelease crashes or hangs if called
after freeing the service context handle. To resolve this Oracle
issue add the following entry to the SQLNET.ORA file on your
HammerDB client.</para>
<programlisting>SQLNET.AUTHENTICATION_SERVICES = (NTS)
DIAG_ADR_ENABLED=OFF
DIAG_SIGHANDLER_ENABLED=FALSE
DIAG_DDE_ENABLED=FALSE</programlisting>
</section>
<section>
<title>SQL Server on Linux: unixODBC's handle validation may become
a performance bottleneck</title>
<para>Using the HammerDB client for SQL Server on Linux can be
slower than the same client on Windows when using the default
installed unixODBC drivers on many Linux distributions. As described
in the <link
xlink:href="https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/programming-guidelines?view=sql-server-ver15">SQL
Server Programming Guidelines</link> "<emphasis>When using the
driver with highly multithreaded applications, unixODBC's handle
validation may become a performance bottleneck. In such scenarios,
significantly more performance may be obtained by compiling unixODBC
with the --enable-fastvalidate option. However, beware that this may
cause applications which pass invalid handles to ODBC APIs to crash
instead of returning SQL_INVALID_HANDLE errors.</emphasis>"
Recompiling unixODBC with the --enable-fastvalidate option has been
measured to improve client performance by 2X. Example configure
options used to build unixODBC are shown as follows:</para>
<programlisting>./configure --prefix=/usr/local/unixODBC --enable-gui=no --enable-drivers=no --enable-iconv
--with-iconv-char-enc=UTF8 --with-iconv-ucode-enc=UTF16LE --enable-threads=yes <emphasis
role="bold">--enable-fastvalidate</emphasis></programlisting>
</section>
</section>
<section>
<title>Linux Font Pre-Installation Requirements</title>
<para>On Linux HammerDB requires the Xft FreeType-based font drawing
library for X installed as follows:</para>
<para>Ubuntu:</para>
<para><programlisting>$ sudo apt-get install libxft-dev</programlisting>Red
Hat:</para>
<programlisting>$ yum install libXft</programlisting>
</section>
</section>
<section>
<title>Documentation License and Copyright</title>
<para>Copyright (C) 2020 Steve Shaw.</para>
<para>Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License, Version
1.3 or any later version published by the Free Software Foundation; with
no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A
copy of the license is included in the section entitled "GNU Free
Documentation License".</para>
</section>
<section>
<title>HammerDB v4.0 New Features</title>
<para>Updated Binaries to: tcl8.6.10, tk8.6.10, thread2.8.5, oratcl4.6,
mysqltcl3.052, pgtcl2.1.1, db2tcl2.0.0</para>
<para>HammerDB v4.0 New Features are all referenced to GitHub issues,
where more details for each new feature and related pull requests can be
found here: <link
xlink:href="https://github.com/TPC-Council/HammerDB/issues">https://github.com/TPC-Council/HammerDB/issues</link></para>
<para>[TPC-Council#152] Inclusive Language Updates</para>
<para>[TPC-Council#149] Add runtimer and waittocomplete routines to
CLI</para>
<para>[TPC-Council#148] HammerDB CLI on Windows can have incorrect
colours</para>
<para>[TPC-Council#140] Update SQL Server ODBC Driver</para>
<para>[TPC-Council#139] Fix XML closing tags for sprocs and
connpool</para>
<para>[TPC-Council#138] Update SQL Server library version number for
TCL8.6.10</para>
<para>[TPC-Council#137] Update versions, changelog and OSS-TPC-x
workloads</para>
<para>[TPC-Council#136] update dbms_random for PostgreSQL neword
infinite loop</para>
<para>[TPC-Council#135] multiple labelled connections / connect pool
feature</para>
<para>[TPC-Council#132] Use Existing User and DB in Postgres</para>
<para>[TPC-Council#126] Adding docs directory and documentation
files</para>
<para>[TPC-Council#124] Make column order in stock_i1 index in
PostgreSQL consistent with Oracle</para>
<para>[TPC-Council#121] Fix temp environment variables not
detected</para>
<para>[TPC-Council#119] Fix for Issue #118 using diset with variables
with spaces</para>
<para>[TPC-Council#115] Add partitioning hints in PostgreSQL neword
transaction</para>
<para>[TPC-Council#106] Format details repo</para>
<para>[TPC-Council#105] Deprecated Redis</para>
<para>[TPC-Council#104] Reverse print out of metrics to put NOPM ahead
of TPM</para>
<para>[TPC-Council#98] MySQL prepared statements and socket
option</para>
<para>[TPC-Council#97] Partitioning for Oracle ORDERS and HISTORY</para>
<para>[TPC-Council#95] PostgreSQL prepared statements for functions and
tablespace option for schema builds</para>
<para>[TPC-Council#92] Refactor Oracle and Postgres procedural code for
performance</para>
<para>[TPC-Council#91] Added Master/Slave Modes to CLI</para>
<para>[TPC-Council#86] Added Geomean calculation to TPC-H
workloads</para>
<para>[TPC-Council#82] Fix distribution of Warehouse across VUs for All
Warehouse option</para>
<para>[TPC-Council#46] Consider changing "Benchmark Options" from TPC-C
or TPC-H to something that underscores "based on TPC-C/TPC-H"</para>
<para>[TPC-Council#19] GUI HD Display</para>
</section>
<section>
<title>Test Matrix</title>
<para>The following test matrix is provided as a guide based on the
operating system and database releases that HammerDB has been built and
tested against. The matrix is not an exclusive support or configuration
matrix and HammerDB has been designed to be compatible with the
supported databases running on different architectures and operating
systems. HammerDB is built for the x88-64 architecture on Linux and
Windows. Where the database is not running on either Linux or Windows on
x86-64 HammerDB can be run on Linux or Windows and connect to the target
database on another architecture over a network.</para>
<para>HammerDB has been built and tested on the following x86 64-bit
Linux and Windows releases.</para>
<para><table>
<title>OS Test Matrix</title>
<tgroup cols="2">
<thead>
<row>
<entry align="center">Operating System</entry>
<entry align="center">Release</entry>
</row>
</thead>
<tbody>
<row>
<entry>Linux</entry>
<entry>Ubuntu 17.X 18.X 19.X / RHEL 7.X RHEL 8.X</entry>
</row>
<row>
<entry>Windows</entry>
<entry>Windows 10</entry>
</row>
</tbody>
</tgroup>
</table></para>
<para>HammerDB has been built and testing on the following x86-64 64-bit
Databases.</para>
<table>
<title>Database Test Matrix</title>
<tgroup cols="2">
<thead>
<row>
<entry align="center">Database (Compatible)</entry>
<entry align="center">Release</entry>
</row>
</thead>
<tbody>
<row>
<entry>Oracle (TimesTen)</entry>
<entry>12c / 18c / 19c</entry>
</row>
<row>
<entry>Microsoft SQL Server</entry>
<entry>2017 / 2019</entry>
</row>
<row>
<entry>Db2</entry>
<entry>11.1</entry>
</row>
<row>
<entry>MySQL (MariaDB) (Amazon Aurora)</entry>
<entry>5.7 / 8.0 / 10.2 / 10.3 / 10.4 / 10.5</entry>
</row>
<row>
<entry>PostgreSQL (EnterpriseDB) (Amazon Redshift)
(Greenplum)</entry>
<entry>10.2 / 10.3 / 11 / 12 / 13</entry>
</row>
</tbody>
</tgroup>
</table>
</section>
<section>
<title>Checksum Verification</title>
<para>Checksums for the installation files are shown alongside the
download files in <link
xlink:href="https://github.com/TPC-Council/HammerDB/releases">GitHub
Releases</link>. The integrity of the HammerDB installation files can be
verified on Windows with the Microsoft File Checksum Integrity Verifier
which can be downloaded at no cost from Microsoft and run as
follows:</para>
<programlisting>fciv -both HammerDB-4.0-Win-x86-64-Setup.exe</programlisting>
<para>and on Linux with md5sum and sha1sum as shown:</para>
<programlisting>md5sum HammerDB-4.0-Linux.tar.gz
sha1sum HammerDB-4.0-Linux.tar.gz</programlisting>
</section>
<section>
<title>Installing and Starting HammerDB on Windows</title>
<para>To install HammerDB on Windows you have the option of using the
self-extracting installer or zipfile. The self-extracting installer will
create an uninstall executable for you. A zipfile installation can be
deleted manually. In both cases the install is entirely self-contained
within the installation directory.</para>
<section>
<title>Self Extracting Installer</title>
<para>Double click on the Setup file and the language choice is
shown.</para>
<para>Click continue to begin the installation.</para>
<figure>
<title>HammerDB Version</title>
<mediaobject>
<imageobject>
<imagedata fileref="docs/images/ch1-4.PNG"/>
</imageobject>
</mediaobject>
</figure>
<para>Read and Accept the GPL License Agreement.</para>
<figure>
<title>GPL v3 License</title>
<mediaobject>
<imageobject>
<imagedata fileref="docs/images/ch1-5.PNG"/>
</imageobject>
</mediaobject>
</figure>
<para>Choose the installation directory.</para>
<figure>
<title>Choose the Installation Directory</title>
<mediaobject>
<imageobject>
<imagedata fileref="docs/images/ch1-6.PNG"/>
</imageobject>
</mediaobject>
</figure>
<para>Press Next to begin the install.</para>
<figure>
<title>Files copying</title>
<mediaobject>
<imageobject>
<imagedata fileref="docs/images/ch1-7.PNG"/>
</imageobject>
</mediaobject>
</figure>
<para>The installer will extract the files into the chosen
directory.</para>
<figure>
<title>Complete</title>
<mediaobject>
<imageobject>
<imagedata fileref="docs/images/ch1-8.PNG"/>
</imageobject>
</mediaobject>
</figure>
<para>Complete the Install by viewing the Readme File and running
HammerDB. If both options are chosen HammerDB will run after the
Readme is closed.</para>
<figure>
<title>Complete the Setup Wizard</title>
<mediaobject>
<imageobject>
<imagedata fileref="docs/images/ch1-8a.PNG"/>
</imageobject>
</mediaobject>
</figure>
<para>HammerDB will start ready for you to use</para>
<figure>
<title>HammerDB Started</title>
<mediaobject>
<imageobject>
<imagedata fileref="docs/images/ch1-9.PNG"/>
</imageobject>
</mediaobject>
</figure>
</section>
<section>
<title>Zip File</title>
<para>As an alternative to the self-extracting installer you can
download and extract the zipfile into a directory of your
choice.</para>
<figure>
<title>Zip File</title>
<mediaobject>
<imageobject>
<imagedata fileref="docs/images/ch1-10.PNG"/>
</imageobject>
</mediaobject>
</figure>
<para/>
</section>
<section>
<title>Starting HammerDB</title>
<para>After installation double-click on the "Windows Batch File"
hammerdb to start hammerdb.</para>
<figure>
<title>hammerdb batch file</title>
<mediaobject>
<imageobject>
<imagedata fileref="docs/images/ch1-11.PNG"/>
</imageobject>
</mediaobject>
</figure>
</section>
<section>
<title>Uninstalling HammerDB</title>
<para>For a zipfile installation, delete the hammerDB directory. For
an installer based installation double-click on uninstall and follow
the on-screen prompts.</para>
<figure>
<title>Uninstall</title>
<mediaobject>
<imageobject>
<imagedata fileref="docs/images/ch1-12.PNG"/>
</imageobject>
</mediaobject>
</figure>
</section>
</section>
<section>
<title>Installing and Starting HammerDB on Linux</title>
<para>To install HammerDB on Linux you have the option of using the
self-extracting installer or a tar.gz file. The self-extracting
installer will create an uninstall executable for you. A tar.gz
installation can be deleted manually. In both cases the install is
entirely self-contained within the installation directory.</para>
<section>
<title>Self Extracting Installer</title>
<para>To install from the self-extracting installer using a graphical
environment refer to the previous section on the self-extracting
installer for Windows, the installation method is the same.</para>
</section>
<section>
<title>Tar.gz File</title>
<para>To install from the tar.gz run the command</para>
<programlisting>tar -zxvf HammerDB-4.0.tar.gz </programlisting>
<para>This will extract HammerDB into a directory named
HammerDB-4.0.</para>
</section>
<section>
<title>Starting HammerDB</title>
<para>To start HammerDB change to the HammerDB directory and run
locally as follows.</para>
<programlisting>./hammerdb</programlisting>
</section>
<section>
<title>Uninstalling HammerDB</title>
<para>To uninstall HammerDB on Linux run the uninstall executable for
the self-extracting installer or remove the directory for the tar.gz
install.</para>
</section>
</section>
<section>
<title>Verifying the Installation of Database Client Libraries</title>
<para>For all of the databases that HammerDB supports it is necessary to
have a third-party client library installed that HammerDB can use to
connect and interact with the database. This client library will also
typically be installed with database server software. HammerDB does not
statically link the 3rd party libraries to minimise executable size and
provide flexibility in the third-party libraries used. For example if a
bug is detected in a particular library then this can be upgraded
without requiring the HammerDB libraries to be rebuilt. However as the
client libraries are dynamically linked it is essential that the correct
client libraries are already installed and environment variables set to
ensure that HammerDB can find the correct libraries. Note that it is
only necessary to load the libraries for the database that your are
testing.</para>
<para>The HammerDB command line tool can be used to check the status of
library availability for all databases.</para>
<para>To run this utility run the following command</para>
<programlisting>./hammerdbcli</programlisting>
<para>and type librarycheck.</para>
<programlisting>HammerDB CLI v4.0
Copyright (C) 2003-2020 Steve Shaw
Type "help" for a list of commands
The xml is well-formed, applying configuration
hammerdb>librarycheck
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 Db2
Success ... loaded library db2tcl for Db2
Checking database library for MySQL
Success ... loaded library mysqltcl for MySQL
Checking database library for PostgreSQL
Success ... loaded library Pgtcl for PostgreSQL
hammerdb>
</programlisting>
<para>in the example it can be seen that the libraries for all databases
were found and loaded. The following table illustrates the first level
library that HammerDB requires however there may be additional
dependencies. Refer to the Test Matrix to determine which database
versions HammerDB was built against. On Windows the <link
xlink:href="https://dependencywalker.com/">Dependency Walker
Utility</link> can be used to determine the dependencies and on Linux
the command ldd.</para>
<para>For example on Windows use dependency walker to open the HammerDB
library for your chosen database. In the following example
libmysqltcl.dll is opened for MySQL. This shows that the key dependency
is on the 64-bit libmysql.dll.</para>
<figure>
<title>Dependency Walker MySQL</title>
<mediaobject>
<imageobject>
<imagedata fileref="docs/images/ch1-13.PNG"/>
</imageobject>
</mediaobject>
</figure>
<para>Right-clicking on this library shows the properties including
where it was found.</para>
<figure>
<title>LIBMYSQL.DLL Properties</title>
<mediaobject>
<imageobject>
<imagedata fileref="docs/images/ch1-14.PNG"/>
</imageobject>
</mediaobject>
</figure>
<para>This location was set in the Environment variables under the Path
option.</para>
<figure>
<title>Environment Variables</title>
<mediaobject>
<imageobject>
<imagedata fileref="docs/images/ch1-15.PNG"/>
</imageobject>
</mediaobject>
</figure>
<para>As shown below hammerDB found the correct MySQL 8.0 library
because the path to the 64-bit MySQL 8.0 library was set correctly in
the environment variables.</para>
<figure>
<title>Path environment variable</title>
<mediaobject>
<imageobject>
<imagedata fileref="docs/images/ch1-16.PNG"/>
</imageobject>
</mediaobject>
</figure>
<para>On Linux we run a similar test with librarycheck, however in this
instance the library file is not found, although note that it identifies
the file that is missing as libmysqlclient.so.21.</para>
<programlisting>Checking database library for MySQL
Error: failed to load mysqltcl - couldn't load file "/home/steve/HammerDB-4.0/lib/mysqltcl-3.052/libmysqltcl3.052.so": libmysqlclient.so.21: cannot open shared object file: No such file or directory
Ensure that MySQL client libraries are installed and the location in the LD_LIBRARY_PATH environment variable
</programlisting>
<para>We can investigate further using the ldd command in an equivalent
way to dependency walker on Windows. This also identifies the file that
is missing.</para>
<programlisting>$ ldd libmysqltcl3.052.so
linux-vdso.so.1 (0x00007ffc44f7d000)
<emphasis role="bold">libmysqlclient.so.21 => not found</emphasis>
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f33e73e7000)
/lib64/ld-linux-x86-64.so.2 (0x00007f33e79e2000)
</programlisting>
<para>Checking in our MySQL installation we can find the file
libmysqlclient.so.21.</para>
<programlisting>$ pwd
/opt/mysql-8.0.18-linux-glibc2.12-x86_64/lib
$ ls libmysqlclient*
libmysqlclient.a libmysqlclient.so libmysqlclient.so.21 libmysqlclient.so.21.1.18
</programlisting>
<para>Therefore we know that the file is installed, however we need to
tell HammerDB where to find it. This is done by adding the MySQL library
to the LD_LIBRARY_PATH.</para>
<programlisting>$ export LD_LIBRARY_PATH=/opt/mysql-8.0.18-linux-glibc2.12-x86_64/lib:$LD_LIBRARY_PATH</programlisting>
<para>Reversing our steps we can see that the library is now
found.</para>
<programlisting>$ ldd libmysqltcl3.052.so
linux-vdso.so.1 (0x00007fff7f7e6000)
libmysqlclient.so.21 => /opt/mysql-8.0.18-linux-glibc2.12-x86_64/lib/libmysqlclient.so.21 (0x00007f92b0153000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f92afd62000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f92afb43000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f92af93f000)
libssl.so.1.1 => /opt/mysql-8.0.18-linux-glibc2.12-x86_64/lib/libssl.so.1.1 (0x00007f92af6b5000)
libcrypto.so.1.1 => /opt/mysql-8.0.18-linux-glibc2.12-x86_64/lib/libcrypto.so.1.1 (0x00007f92af270000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f92af068000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f92aecdf000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f92ae941000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f92ae729000)
/lib64/ld-linux-x86-64.so.2 (0x00007f92b0c34000)</programlisting>
<para>and library check confirms that it can be loaded.</para>
<programlisting>Checking database library for MySQL
Success ... loaded library mysqltcl for MySQL</programlisting>
<para>Add the export command to the .bash_profile ensures that it will
be found each time HammerDB is launched from a new shell.</para>
<para>The following table shows the libraries that are required for each
database version. All libraries are 64-bit. Note that some databases are
considerably more flexible in library versions and therefore the
following section is important to ensure that you install the correct
library for your needs.</para>
<table>
<title>3rd party libraries</title>
<tgroup cols="2">
<thead>
<row>
<entry align="center">Database / OS</entry>
<entry align="center">Library</entry>
</row>
</thead>
<tbody>
<row>
<entry>Oracle Linux</entry>
<entry>libclntsh.so</entry>
</row>
<row>
<entry>Oracle Windows</entry>
<entry>OCI.DLL</entry>
</row>
<row>
<entry>SQL Server Linux</entry>
<entry>libodbc.so</entry>
</row>
<row>
<entry>SQL Server Windows</entry>
<entry>ODBC32.DLL</entry>
</row>
<row>
<entry>Db2 Linux</entry>
<entry>libdb2.so</entry>
</row>
<row>
<entry>Db2 Windows</entry>
<entry>DB2CLI64.DLL</entry>
</row>
<row>
<entry>MySQL Linux</entry>
<entry>libmysqlclient.so</entry>
</row>
<row>
<entry>MySQL Windows</entry>
<entry>LIBMYSQL.DLL</entry>
</row>
<row>
<entry>PostgreSQL Linux</entry>
<entry>libpq.so</entry>
</row>
<row>
<entry>PostgreSQL Windows</entry>
<entry>LIBPQ.DLL</entry>
</row>
</tbody>
</tgroup>
</table>
<section>
<title>Oracle Client</title>
<para>When using the Oracle instant client Oratcl uses the additional
environment variable ORACLE_LIBRARY to identify the Oracle client
library. On the Windows the Oracle client library is called oci.dll in
a location such as: C:\oraclexe\app\oracle\product\11.2.0\server\bin.
On Linux the library is called libclntsh.so where this is typically a
symbolic link to a product specific name such as libclntsh.so.12.1 for
Oracle 12c. An example .bash_profile file is shown for a typical
Oracle environment.</para>
<programlisting>oracle@server1 oracle]$ cat ~/.bash_profile
# .bash_profile
if [ -t 0 ]; then
stty intr ^C
fi
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
umask 022
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/dbhome_1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export ORACLE_LIBRARY=$ORACLE_HOME/lib/libclntsh.so
export ORACLE_SID=PROD1
export PATH=$ORACLE_HOME/bin:$PATH
</programlisting>
</section>
<section>
<title>SQL Server</title>
<para>On SQL Server on Windows the client libraries and necessary
environment variables are set automatically during the SQL Server
installation. Note that on 64-bit Windows the 64-bit ODBC client
library is named ODBC32.DLL in the following location.
C:\Windows\System32\odbc32.dll. On Linux follow the SQL Server on
Linux installation guide to install 'mssql-tools' with the unixODBC
developer package. The command database drivers will show the
installed ODBC Driver.</para>
<programlisting>hammerdb>database drivers
{{ODBC Driver 17 for SQL Server} {{Description=Microsoft ODBC Driver 17 for SQL Server}
Driver=/opt/microsoft/msodbcsql/lib64/libmsodbcsql-17.0.so.1.1 UsageCount=1}}</programlisting>
</section>
<section>
<title>Db2</title>
<para>For DB2 on Linux the client library libdb2.so.1 is required
either in the lib64 directory for 32. Similarly on Windows the
db2cli64.dll is required. These libraries are included with a standard
DB2 installation or also with a standalone DB2 client install.</para>
</section>
<section>
<title>MySQL</title>
<para>HammerDB version 4.0 (and version 3.3) has been built and tested
against a MySQL 8.0 client installation, hammerDB version 3.0-3.2 has
been built against MySQL 5.7. On Linux this means that HammerDB will
require a MySQL client library called libmysqlclient.so.21 for
HammerDB version 4.0 and 3.3 and libmysqlclient.so.20 for version 3.2
and earlier. This client library needs to be referenced in the
LD_LIBRARY_PATH as shown previously in this section. Note that for
testing MariaDB you also need the libmysqlclient.so.21 from an
installation of MySQL 8.0. You do not need to install MySQL 8.0 as the
only file you need is "libmysqlclient.so.21". With this file installed
and in the library path the HammerDB client can connect to
MariaDB.</para>
</section>
<section>
<title>PostgreSQL</title>
<para>For PostgreSQL the client library is called libpq.dll on Windows
and libpq.so on Linux however note that additional libraries are also
required. For Windows this means setting your PATH environment
variable such as the following: D:\PostgreSQL\pgsql\bin; On Linux it
is required to set the LD_LIBRARY_PATH environment variable in the
same way described for Oracle previously in this section to the
location of the PostgreSQL lib directory. Alternatively for
installations of EnterpriseDB the client directory also contains the
necessary files for a HammerDB installation.</para>
</section>
</section>
<section>
<title>XML Configuration</title>
<para>HammerDB configuration and settings are defined in a number of XML
files in the config directory. You may edit these files to change the
configuration on startup, however it is recommended to save a copy of
the original in case of incompatible changes.</para>
<figure>
<title>XML Configuration Files</title>
<mediaobject>
<imageobject>
<imagedata fileref="docs/images/ch1-17.PNG"/>
</imageobject>
</mediaobject>
<para>By default the databases in the GUI menu are listed in the order
that the workloads were added to HammerDB. If you wish to change the
order to put a particular database first you can change the rdbms
value in generic.xml to the name of the database of your choice. The
name entry for a particular database can be found in the database.xml
file. For example the following would set SQL Server to be the
database at the top of the menu on startup.</para>
<programlisting><benchmark>
<rdbms>MSSQLServer</rdbms>
<bm>TPC-C</bm>
<first_result>NOPM</first_result>
</benchmark></programlisting>
</figure>
</section>
<section>
<title>Themes and Scalable Graphics</title>
<para>HammerDB v4.0 includes an updated graphical interface that adapts
to scale to UHD displays such as Microsoft pixelsense displays. The
behaviour of the display is set in the theme section of
generic.xml.</para>
<programlisting><theme>
<scaling>auto</scaling>
<scaletheme>auto</scaletheme>
<pixelsperpoint>auto</pixelsperpoint>
</theme></programlisting>
<para>By default scaling, the scaletheme and pixelsperpoint are all set
to auto. This means that HammerDB will detect the display settings and
scale the interface accordingly. For example the image shows HammerDB
v3.3 and v4.0 on the same UHD display.</para>
<figure>
<title>Scaling Graphics</title>
<mediaobject>
<imageobject>
<imagedata fileref="docs/images/ch1-18.PNG"/>
</imageobject>
</mediaobject>
</figure>
<para>However some displays or third-party X Windows servers may not be
updated to support scalable graphics. In this case the scaling value can
be set to fixed and a standard 96 dpi display will be used with the
fixed themes from HammerDB v3.3.</para>
<programlisting><theme>
<scaling>fixed</scaling>
<scaletheme>auto</scaletheme>
<pixelsperpoint>auto</pixelsperpoint>
</theme></programlisting>
<para>The scaletheme value will accept settings of "auto", "awlight",
"arc" or "breeze". If set to the default of "auto", "awlight" will be
used on Linux.</para>
<figure>
<title>Linux Theme Awlight</title>
<mediaobject>