1.创建用户和数据库
[postgres#localhost ~] $ psql postgres
psql (9.5.2)
Type "help" for help.
postgres=# CREATE USER benchmarksql WITH ENCRYPTED PASSWORD 'changeme';
postgres=# CREATE DATABASE benchmarksql OWNER benchmarksql;
postgres=# \q
2.解压
[postgres@localhost run]$unzip benchmarksql-5.0.zip
[postgres@localhost ~] $ cd benchmarksql-5.0
[postgres@localhost benchmarksql-5.0]$ ant
bash: ant: command not found...
解决方法:
安装ant
[root@localhost etc]# yum install ant
[postgres@localhost benchmarksql-5.0]$ ant
Buildfile: /tmp/benchmarksql-5.0/build.xml
init:
[mkdir] Created dir: /tmp/benchmarksql-5.0/build
compile:
[javac] Compiling 11 source files to /tmp/benchmarksql-5.0/build
dist:
[mkdir] Created dir: /tmp/benchmarksql-5.0/dist
[jar] Building jar: /tmp/benchmarksql-5.0/dist/BenchmarkSQL-5.0.jar
BUILD SUCCESSFUL
Total time: 2 seconds
3.修改文件
[postgres@localhost benchmarksql] $ cd run
[postgres@localhost run] $ cp props.pg my_postgres.properties
[postgres@localhost run] $ vi my_postgres.properties
[postgres@localhost run] $
4.构建模式和初始数据库加载
[postgres@localhost run]$ ./runDatabaseBuild.sh my_postgres.properties
# ------------------------------------------------------------
# Loading SQL file ./sql.common/tableCreates.sql
# ------------------------------------------------------------
create table bmsql_config (
cfg_name varchar(30) primary key,
cfg_value varchar(50)
);
Starting BenchmarkSQL LoadData
driver=org.postgresql.jdbc.Driver
conn=jdbc:postgresql://localhost:5866/benchmarksql
user=benchmarksql
password=***********
warehouses=1
loadWorkers=4
fileLocation (not defined)
csvNullValue (not defined - using default 'NULL')
Worker 000: Loading ITEM
Worker 001: Loading Warehouse 1
Worker 000: Loading ITEM done
Worker 001: Loading Warehouse 1 done
# ------------------------------------------------------------
# Loading SQL file ./sql.common/indexCreates.sql
# ------------------------------------------------------------
# ------------------------------------------------------------
# Loading SQL file ./sql.postgres/extraHistID.sql
# ------------------------------------------------