[oracle@king01 ~]$ sqlplus / as sysdba
SQL> create tablespace tpcc
datafile '/u01/app/oracle/oradata/king/tpcc01.dbf'
size 1024M
extent management local
uniform size 1M;
Tablespace created.
SQL> create user tpcc identified by tpcc default tablespace tpcc;
User created.
SQL> grant connect,resource to tpcc;
Grant succeeded.
[root@king02 ~]# yum install -y ant
[root@king02 ~]# unzip benchmarksql-5.0.zip
[root@king02 ~]# cd benchmarksql-5.0
[root@king02 benchmarksql-5.0]# ant
Buildfile: build.xml
init:
[mkdir] Created dir: /root/benchmarksql-5.0/build
compile:
[javac] Compiling 11 source files to /root/benchmarksql-5.0/build
[javac] This version of java does not support the classic compiler; upgrading to modern
dist:
[mkdir] Created dir: /root/benchmarksql-5.0/dist
[jar] Building jar: /root/benchmarksql-5.0/dist/BenchmarkSQL-5.0.jar
BUILD SUCCESSFUL
Total time: 3 seconds
[root@king02 benchmarksql-5.0]# cd run
[root@king02 run]# vi props.ora
db=oracle
driver=oracle.jdbc.driver.OracleDriver
conn=jdbc:oracle:thin:@192.168.1.201:1521:king
user=tpcc
password=tpcc
warehouses=10
loadWorkers=5
terminals=10
//To run specified transactions per terminal- runMins must equal zero
runTxnsPerTerminal=1000
//To run for specified minutes- runTxnsPerTerminal must equal zero
runMins=0
//Number of total transactions per minute
limitTxnsPerMin=300
//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
[root@king02 run]# ./runDatabaseBuild.sh props.ora
[root@king02 run]# ./runBenchmark.sh props.ora
21:45:16,311 [main] INFO jTPCC : Term-00,
21:45:16,326 [main] INFO jTPCC : Term-00, +-------------------------------------------------------------+
21:45:16,326 [main] INFO jTPCC : Term-00, BenchmarkSQL v5.0
21:45:16,326 [main] INFO jTPCC : Term-00, +-------------------------------------------------------------+
21:45:16,326 [main] INFO jTPCC : Term-00, (c) 2003, Raul Barbosa
21:45:16,326 [main] INFO jTPCC : Term-00, (c) 2004-2016, Denis Lussier
21:45:16,336 [main] INFO jTPCC : Term-00, (c) 2016, Jan Wieck
21:45:16,337 [main] INFO jTPCC : Term-00, +-------------------------------------------------------------+
21:45:16,337 [main] INFO jTPCC : Term-00,
21:45:16,337 [main] INFO jTPCC : Term-00, db=oracle
21:45:16,337 [main] INFO jTPCC : Term-00, driver=oracle.jdbc.driver.OracleDriver
21:45:16,337 [main] INFO jTPCC : Term-00, conn=jdbc:oracle:thin:@192.168.1.201:1521:king
21:45:16,337 [main] INFO jTPCC : Term-00, user=tpcc
21:45:16,338 [main] INFO jTPCC : Term-00,
21:45:16,338 [main] INFO jTPCC : Term-00, warehouses=10
21:45:16,338 [main] INFO jTPCC : Term-00, terminals=10
21:45:16,345 [main] INFO jTPCC : Term-00, runTxnsPerTerminal=1000
21:45:16,345 [main] INFO jTPCC : Term-00, limitTxnsPerMin=300
21:45:16,348 [main] INFO jTPCC : Term-00, terminalWarehouseFixed=true
21:45:16,349 [main] INFO jTPCC : Term-00,
21:45:16,349 [main] INFO jTPCC : Term-00, newOrderWeight=45
21:45:16,349 [main] INFO jTPCC : Term-00, paymentWeight=43
21:45:16,349 [main] INFO jTPCC : Term-00, orderStatusWeight=4
21:45:16,349 [main] INFO jTPCC : Term-00, deliveryWeight=4
21:45:16,349 [main] INFO jTPCC : Term-00, stockLevelWeight=4
21:45:16,349 [main] INFO jTPCC : Term-00,
21:45:16,353 [main] INFO jTPCC : Term-00, resultDirectory=null
21:45:16,353 [main] INFO jTPCC : Term-00, osCollectorScript=null
21:45:16,353 [main] INFO jTPCC : Term-00,
21:45:18,823 [main] INFO jTPCC : Term-00, C value for C_LAST during load: 231
21:45:18,823 [main] INFO jTPCC : Term-00, C value for C_LAST this run: 133
21:45:18,824 [main] INFO jTPCC : Term-00,
Term-00, Running Average tpmTOTAL: 294.45 Current tpmTOTAL: 26748 Memory Usage: 23MB / 57MB
Term-00, Running Average tpmTOTAL: 296.45 Current tpmTOTAL: 65652 Memory Usage: 21MB / 57MB
22:19:06,361 [Thread-9] INFO jTPCC : Term-00,
22:19:06,361 [Thread-9] INFO jTPCC : Term-00,
22:19:06,362 [Thread-9] INFO jTPCC : Term-00, Measured tpmC (NewOrders) = 134.17
22:19:06,362 [Thread-9] INFO jTPCC : Term-00, Measured tpmTOTAL = 296.16
22:19:06,363 [Thread-9] INFO jTPCC : Term-00, Session Start = 2019-05-25 21:45:20
22:19:06,363 [Thread-9] INFO jTPCC : Term-00, Session End = 2019-05-25 22:19:06
[root@king02 run]# ./runDatabaseDestroy.sh props.ora
# ------------------------------------------------------------
# Loading SQL file ./sql.common/tableDrops.sql
# ------------------------------------------------------------
drop table bmsql_config;
drop table bmsql_new_order;
drop table bmsql_order_line;
drop table bmsql_oorder;
drop table bmsql_history;
drop table bmsql_customer;
drop table bmsql_stock;
drop table bmsql_item;
drop table bmsql_district;
drop table bmsql_warehouse;
drop sequence bmsql_hist_id_seq;
网页名称:【OracleDatabase】数据库性能测试工具:BenchmarkSQL
网页URL:
http://kswsj.cn/article/iegpop.html