首页 > 数据库 > > GaussDB100之BenchmarkSQL应用
1、工具benchmarksql-5.0.zip(https://sourceforge.net/projects/benchmarksql/)
2、执行方法
(1)解压工具包
1 | unzip benchmarksql-5.0.zip |
(2)编译
1 2 | cd benchmarksql-5.0ant |
(3)拷贝数据库JDBC驱动至工具的lib路径
(4)添加配置文件
1 2 3 | cd runvi props.zenith |
将以下内容拷贝到新增文件
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 | db=oracledriver=com.huawei.gauss.jdbc.ZenithDriverconn=jdbc:zenith:@127.0.0.1:1888user=testerpassword=Database_123warehouses=10loadWorkers=10terminals=10//To run specified transactions per terminal- runMins must equal zerorunTxnsPerTerminal=0//To run for specified minutes- runTxnsPerTerminal must equal zerorunMins=5//Number of total transactions per minutelimitTxnsPerMin=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 100newOrderWeight=45paymentWeight=43orderStatusWeight=4deliveryWeight=4stockLevelWeight=4// Directory name to create for collecting detailed result data.// Comment this out to suppress.resultDirectory=my_result_%tY-%tm-%td_%tH%tM%tSosCollectorScript=./misc/os_collector_linux.pyosCollectorInterval=1//osCollectorSSHAddr=user@dbhost//osCollectorDevices=net_eth0 blk_sda |
(5)安装数据库
1 2 3 4 5 6 7 8 9 | groupadd dbgrpuseradd -g dbgrp -d /home/gaussdba -m -s /bin/bash gaussdbatar -zxvf Gauss100-OLTP-V300R001C00-ZENGINE-REDHAT-64bit_release.tar.gzcd /opt/software/gaussdb/GaussDB-100-V300R001C00SPC200B130/GAUSSDB100-V300R001C00-DATABASE-EULER20SP3-64bitpython 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)创建普通用户
1 2 3 | 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)导入数据
1 | ./runDatabaseBuild.sh props.zenith |
(8)执行业务
1 | ./runBenchmark.sh props.zenith |
(9)清理数据
1 | ./runDatabaseDestroy.sh props.zenith |
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69959250/viewspace-3165639/ ,如需转载,请注明出处,否则将追究法律责任。