benchmarksql
准备环境
启动达梦数据库;
准备JDK1.8以上环境;
下载解压benchmarksql5.0;
上传达梦数据库jdbc驱动包:
达梦驱动包:DmJdbcDriver18.jar
上传目录:/home/setup/tpcc/benchmarksql-5.0/lib/
编译工具准备
配置apache-ant的环境变量:
[root@dbtest jdbc]# vi ~/.bash_profile
#添加以下内容
export APACH_HOME=/home/setup/tpcc/apache-ant-1.10.3
export PATH= P A T H : PATH: PATH:APACH_HOME/bin:
[root@dbtest jdbc]# source ~/.bash_profile
编译前如果没有安装jdk1.8的话,执行yum install java-1.8.0-openjdk* -y
本步骤是编译benchmarksql-5.0工具,生成jar文件:
/benchmarksql-5.0/dist/BenchmarkSQL-5.0.jar
[root@dbtest benchmarksql-5.0]# yum install java-1.8.0-openjdk* -y
[root@dbtest benchmarksql-5.0]# ant
编辑初始化配置
修改benchmarksql-5.0/src/client下的jTPCC.java,增加dm相关部分
if (iDB.equals("firebird"))
dbType = DB_FIREBIRD;
else if (iDB.equals("oracle"))
dbType = DB_ORACLE;
else if (iDB.equals("postgres"))
dbType = DB_POSTGRES;
else if (iDB.equals("dm"))
dbType = DB_UNKNOWN;
else
{
log.error("unknown database type '" + iDB + "'");
return;
}
复制一个props.ora 该名为props.dm 并修改内容
#cp props.ora props.dm
#vi props.dm
db=oracle
driver=dm.jdbc.driver.DmDriver
conn=jdbc:dm://192.168.21.201:5236/DAMENG
user=BENCHMARKSQL
password=123456789
warehouses=8
loadWorkers=8
terminals=32
//To run specified transactions per terminal- runMins must equal zero
runTxnsPerTerminal=0
//To run for specified minutes- runTxnsPerTerminal must equal zero
runMins=5
//Number of total transactions per minute
limitTxnsPerMin=0
//Set to true to run in 4.x compatible mode. Set to false to use the
//entire configured database evenly.
terminalWarehouseFixed=true
//The following five values must add up to 100
//The default percentages of 45, 43, 4, 4 & 4 match the TPC-C spec
newOrderWeight=45
paymentWeight=43
orderStatusWeight=4
deliveryWeight=4
stockLevelWeight=4
// Directory name to create for collecting detailed result data.
// Comment this out to suppress.
resultDirectory=myresult%tY-%tm-%td_%tH%tM%tS
osCollectorScript=./misc/os_collector_linux.py
osCollectorInterval=