- Download H2 database from its official download link or use the zip file in this folder. The H2 version tested in our paper is 1.4.200.
- Install the H2 database following its guide, or use following command:
unzip h2-2019-10-14.zip
- Start the H2 TCP Server by executing following commands at the server machine:
cd h2/bin
java -cp h2*.jar org.h2.tools.Server -tcp -tcpAllowOthers -ifNotExists -tcpPassword 'yourpassword' &
-
Install stored procedures. In H2, Java functions can be used as stored procedures(SP). A function must be declared (registered) before it can be used. There are two different ways. We choose to define functions using source code. Details about SP in H2 can be found here.
Following is the command to install functions(.sql file) into H2 database:
java -cp h2*.jar org.h2.tools.RunScript -url "jdbc:h2:tcp://[server IP address]:9092/mem:benchbase;DB_CLOSE_DELAY=-1" -user [yourusername] -password [yourpassword] -script [.sql_filename]
- When you need to stop the H2 server:
java org.h2.tools.Server -tcpShutdown tcp://[server IP address]:9092 -tcpPassword 'yourpassword'
- The H2 official tutorial can also help you setup the server.
- The repository has moved to Benchbase.
- Clone OLTPBench(Benchbase):
git clone --depth 1 https://github.com/cmu-db/benchbase.git
- Add H2 database dependency in pom.xml:
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.200</version>
</dependency>
- Build Benchbase:
cd benchbase
./mvnw clean package #This produces artifacts in the target folder
cd target
tar xvzf benchbase-x-SNAPSHOT.tgz # Change x appropriately.
cd benchbase-x-SNAPSHOT
- Add support for H2 database:
cd benchbase-x-SNAPSHOT/config
mkdir h2
- Then, copy sample_tpcc_config.xml into this h2 folder. Change the elements to your settings, like the server IP address in url, username and password.
- Run the benchmark in the benchbase-x-SNAPSHOT directory:
java -jar benchbase.jar -b tpcc -c config/h2/sample_tpcc_config.xml --create=true --load=true --execute=true -d [output_file]
- Benchbase provides more details about how to run. Please refer to it for details.