赞
踩
下载软件
benchmarksql-5.0.zip
解压
unzip benchmarksql-4.1.1.zip /root/benchmarksql-4.1.1/lib/
复制驱动文件到lib 下
cp /dm8/drivers/jdbc/DmJdbcDriver18.jar
编辑配置文件
[root@oracle run]# pwd /root/benchmarksql-4.1.1/run [root@oracle run]# cat props.dm driver=dm.jdbc.driver.DmDriver conn=jdbc:dm://localhost:8881 user=benchmarksql password=Dameng123@ warehouses=2 terminals=1 //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 //The following five values must add up to 100 newOrderWeight=45 paymentWeight=43 orderStatusWeight=4 deliveryWeight=4 stockLevelWeight=4
创建用户
create user benchmarksql identified by "Dameng123@";
grant dba to benchmarksql;
创建测试用得表
create table benchmarksql.warehouse ( w_id int not null , w_ytd float , w_tax float , w_name varchar(10), w_street_1 varchar(20), w_street_2 varchar(20), w_city varchar(20), w_state char(2) , w_zip char(9) , cluster primary key(w_id) ) storage ( fillfactor 2, without counter ); create table benchmarksql.district ( d_w_id int not null , d_id int not null , d_ytd float , d_tax float , d_next_o_id int , d_name varchar(10), d_street_1 varchar(20), d_street_2 varchar(20), d_city varchar(20), d_state char(2) , d_zip char(9) , cluster primary key(d_w_id, d_id) ) storage ( fillfactor 3, without counter ); create table benchmarksql.customer ( c_w_id int not null , c_d_id int not null , c_id int not null , c_discount float , c_credit char(2) , c_last varchar(16) , c_first varchar(16) , c_credit_lim float , c_balance float , c_ytd_payment float , c_payment_cnt int , c_delivery_cnt int , c_street_1 varchar(20), c_street_2 varchar(20), c_city varchar(20), c_state char(2) , c_zip char(9) , c_phone char(16) , c_since timestamp , c_middle char(2) , c_data varchar(500) , cluster primary key(c_w_id, c_d_id, c_id) ) storage ( without counter ); create sequence benchmarksql.hist_id_seq; create table benchmarksql.history ( hist_id int default benchmarksql.hist_id_seq.NEXTVAL, h_c_id int , h_c_d_id int , h_c_w_id int , h_d_id int , h_w_id int , h_date timestamp , h_amount float , h_data varchar(24) ) storage ( branch(16, 16), without counter ); create table benchmarksql.oorder ( o_w_id int not null, o_d_id int not null, o_id int not null, o_c_id int , o_carrier_id int , o_ol_cnt float , o_all_local float , o_entry_d timestamp , cluster primary key(o_w_id, o_d_id, o_id) ) storage ( without counter ); create table benchmarksql.new_order ( no_w_id int not null, no_d_id int not null, no_o_id int not null, cluster primary key(no_w_id, no_d_id, no_o_id) ) storage ( without counter ); create table benchmarksql.order_line ( ol_w_id int not null , ol_d_id int not null , ol_o_id int not null , ol_number int not null , ol_i_id int not null , ol_delivery_d timestamp, ol_amount float , ol_supply_w_id int , ol_quantity float , ol_dist_info char(24) , cluster primary key(ol_w_id, ol_d_id, ol_o_id, ol_number) ) storage ( without counter ); create table benchmarksql.stock ( s_w_id int not null , s_i_id int not null , s_quantity float , s_ytd float , s_order_cnt int , s_remote_cnt int , s_data varchar(50), s_dist_01 char(24) , s_dist_02 char(24) , s_dist_03 char(24) , s_dist_04 char(24) , s_dist_05 char(24) , s_dist_06 char(24) , s_dist_07 char(24) , s_dist_08 char(24) , s_dist_09 char(24) , s_dist_10 char(24) , cluster primary key(s_i_id, s_w_id) ) storage ( without counter ); create table benchmarksql.item ( i_id int not null, i_name varchar(24) , i_price float , i_data varchar(50) , i_im_id int , cluster primary key(i_id) ) storage ( without counter ); create index ndx_customer_name on benchmarksql.customer ( c_w_id, c_d_id, c_last, c_first );
装载数据
[root@oracle run]# pwd /root/benchmarksql-4.1.1/run [root@oracle run]# ./runLoader.sh props.dm numWAREHOUSES 1 Starting BenchmarkSQL LoadData ----------------- Initialization ------------------- numWAREHOUSES 1 driver=dm.jdbc.driver.DmDriver conn=jdbc:dm://localhost:8881 user=benchmarksql password=****** ------------- LoadData StartTime = Thu Nov 19 16:57:02 CST 2020------------- .................. .................. ------------- LoadJDBC Statistics -------------------- Start Time = Thu Nov 19 16:57:02 CST 2020 End Time = Thu Nov 19 16:57:04 CST 2020 Run Time = 1 Seconds Rows Loaded = 40002 Rows Rows Per Second = 40002 Rows/Sec ------------------------------------------------------
创建索引
create
index ndx_customer_name on benchmarksql.customer
(
c_w_id,
c_d_id,
c_last,
c_first
);
创建存储过程
create or replace
procedure benchmarksql.createsequence
as
n int;
stmt varchar(100);
begin
stmt:='drop sequence benchmarksql.hist_id_seq';
EXECUTE IMMEDIATE stmt;
select max(hist_id) + 1 into n from benchmarksql.history ;
stmt:='create sequence benchmarksql.hist_id_seq start with '||n;
EXECUTE IMMEDIATE stmt;
end;
预热数据让测试更加准确
select count(*) from "BENCHMARKSQL"."CUSTOMER" union all select count(*) from "BENCHMARKSQL"."DISTRICT" union all select count(*) from "BENCHMARKSQL"."ITEM" union all select count(*) from "BENCHMARKSQL"."NEW_ORDER" union all select count(*) from "BENCHMARKSQL"."OORDER" union all select count(*) from "BENCHMARKSQL"."ORDER_LINE" union all select count(*) from "BENCHMARKSQL"."STOCK" union all select count(*) from "BENCHMARKSQL"."WAREHOUSE" union all select count(*) from "BENCHMARKSQL"."HISTORY" union all select count("C_PAYMENT_CNT") from "BENCHMARKSQL"."CUSTOMER"; commit;
开始测试
[root@oracle run]# ./runBenchmark.sh props.dm 2020-11-19 17:01:40,369 INFO - Term-00, 2020-11-19 17:01:40,369 INFO - Term-00, +-------------------------------------------------------------+ 2020-11-19 17:01:40,369 INFO - Term-00, BenchmarkSQL v4.1.1 2020-11-19 17:01:40,370 INFO - Term-00, +-------------------------------------------------------------+ 2020-11-19 17:01:40,370 INFO - Term-00, (c) 2003, Raul Barbosa 2020-11-19 17:01:40,370 INFO - Term-00, (c) 2004-2016, Denis Lussier 2020-11-19 17:01:40,370 INFO - Term-00, (c) 2016, Jan Wieck 2020-11-19 17:01:40,370 INFO - Term-00, +-------------------------------------------------------------+ 2020-11-19 17:01:40,370 INFO - Term-00, 2020-11-19 17:01:40,370 INFO - Term-00, driver=dm.jdbc.driver.DmDriver 2020-11-19 17:01:40,370 INFO - Term-00, conn=jdbc:dm://localhost:8881 2020-11-19 17:01:40,370 INFO - Term-00, user=benchmarksql 2020-11-19 17:01:40,370 INFO - Term-00, 2020-11-19 17:01:40,370 INFO - Term-00, warehouses=2 2020-11-19 17:01:40,371 INFO - Term-00, terminals=1 2020-11-19 17:01:40,371 INFO - Term-00, runMins=5 2020-11-19 17:01:40,371 INFO - Term-00, limitTxnsPerMin=0 2020-11-19 17:01:40,371 INFO - Term-00, 2020-11-19 17:01:40,371 INFO - Term-00, newOrderWeight=45 2020-11-19 17:01:40,371 INFO - Term-00, paymentWeight=43 2020-11-19 17:01:40,371 INFO - Term-00, orderStatusWeight=4 2020-11-19 17:01:40,371 INFO - Term-00, deliveryWeight=4 2020-11-19 17:01:40,371 INFO - Term-00, stockLevelWeight=4 2020-11-19 17:01:40,371 INFO - Term-00, ...............
测试日志
[root@oracle log]# pwd
/root/benchmarksql-4.1.1/run/log
[root@oracle log]# ls
BenchmarkSQLError.log benchmarksql.log
本文章是简单配置一下进行数据库得测试。如果想要更加了解benchmarksql,请参考benchmarksql简介
链接文章为转载
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。