1、工具benchmarksql-5.0.zip(https://sourceforge.net/projects/benchmarksql/)
2、执行方法
(1)解压工具包
unzip benchmarksql-5.0.zip
(2)编译
cd benchmarksql-5.0
ant
(3)拷贝数据库JDBC驱动至工具的lib路径
(4)添加配置文件
cd run
vi props.zenith
将以下内容拷贝到新增文件
db=oracle
driver=com.huawei.gauss.jdbc.ZenithDriver
conn=jdbc:zenith:@127.0.0.1:1888
user=tester
password=Database_123
warehouses=10
loadWorkers=10
terminals=10
//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
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=my_result_%tY-%tm-%td_%tH%tM%tS
osCollectorScript=./misc/os_collector_linux.py
osCollectorInterval=1
//osCollectorSSHAddr=user@dbhost
//osCollectorDevices=net_eth0 blk_sda
(5)安装数据库
groupadd dbgrp
useradd -g dbgrp -d /home/gaussdba -m -s /bin/bash gaussdba
tar -zxvf Gauss100-OLTP-V300R001C00-ZENGINE-REDHAT-64bit_release.tar.gz
cd /opt/software/gaussdb/GaussDB-100-V300R001C00SPC200B130/GAUSSDB100-V300R001C00-DATABASE-EULER20SP3-64bit
python install.py -U gaussdba:dbgrp -R /home/gaussdba/app -D /home/gaussdba/data -C LSNR_ADDR=127.0.0.1 -C LSNR_PORT=1888
(6)创建普通用户
su - gaussdbazsql sys/Changeme_123@127.0.0.1:1888 -q -c ""CREATE USER tester IDENTIFIED BY Database_123;""
zsql sys/Changeme_123@127.0.0.1:1888 -q -c ""GRANT DBA TO tester;""
(7)导入数据
./runDatabaseBuild.sh props.zenith
(8)执行业务
./runBenchmark.sh props.zenith
(9)清理数据
./runDatabaseDestroy.sh props.zenith