当前位置:   article > 正文

达梦数据库TPCC性能测试_达梦数据库性能测试

达梦数据库性能测试

1、安装bms.tar.gz
[root@dmdb04 ~]# tar -xzf bms.tar.gz
[root@dmdb04 ~]# mv benchmarksql-5.0rc2-westone-v1.2 /usr/local/benchmarksql

2、修改/usr/local/benchmarksql/run/props.dm
warehouses=10
loadWorkers=2
runMins=1

3、创建用户、表空间、9张表
DROP USER “BENCHMARKSQL” CASCADE;
DROP TABLESPACE BENCHMARKSQL1;

CREATE TABLESPACE BENCHMARKSQL1 DATAFILE ‘BENCHMARKSQL1.dbf’ size 256 autoextend on next 1024 maxsize 10240 cache=NORMAL;

CREATE USER “BENCHMARKSQL” IDENTIFIED BY “123456789” DEFAULT TABLESPACE “BENCHMARKSQL1”;
GRANT DBA,public,resource,soi,vti TO BENCHMARKSQL;

create table BENCHMARKSQL.bmsql_config (
cfg_name varchar(30) cluster primary key,
cfg_value varchar(50)
);

create table BENCHMARKSQL.bmsql_warehouse (
w_id integer not null,
w_ytd decimal(22,2),
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 1);

create table BENCHMARKSQL.bmsql_district (
d_w_id integer not null,
d_id integer not null,
d_ytd decimal(22,2),
d_tax float,
d_next_o_id integer,
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 1);

create table BENCHMARKSQL.bmsql_customer (
c_w_id integer not null,
c_d_id integer not null,
c_id integer 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 integer,
c_delivery_cnt integer,
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));

create table BENCHMARKSQL.bmsql_history (
hist_id integer,
h_c_id integer,
h_c_d_id integer,
h_c_w_id integer,
h_d_id integer,
h_w_id integer,
h_date timestamp,
h_amount float,
h_data varchar(24)
)storage(branch(32,32),without counter);

create table BENCHMARKSQL.bmsql_oorder (
o_w_id integer not null,
o_d_id integer not null,
o_id integer not null,
o_c_id integer,
o_carrier_id integer,
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.bmsql_new_order (
no_w_id integer not null,
no_d_id integer not null,
no_o_id integer not null,
cluster primary key(no_w_id, no_d_id, no_o_id)
)storage(without counter);

create table BENCHMARKSQL.bmsql_order_line (
ol_w_id integer not null,
ol_d_id integer not null,
ol_o_id integer not null,
ol_number integer not null,
ol_i_id integer not null,
ol_delivery_d timestamp,
ol_amount float,
ol_supply_w_id integer,
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.bmsql_stock (
s_w_id integer not null,
s_i_id integer not null,
s_quantity float,
s_ytd float,
s_order_cnt integer,
s_remote_cnt integer,
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_w_id, s_i_id));

create table BENCHMARKSQL.bmsql_item (
i_id integer not null,
i_name varchar(24),
i_price float,
i_data varchar(50),
i_im_id integer,
cluster primary key(i_id)
);

–观察表数据的变化
select * from dba_tables where owner=‘BENCHMARKSQL’;

select count() from BENCHMARKSQL.BMSQL_CONFIG union all
select count(
) from BENCHMARKSQL.BMSQL_WAREHOUSE union all
select count() from BENCHMARKSQL.BMSQL_DISTRICT union all
select count(
) from BENCHMARKSQL.BMSQL_CUSTOMER union all
select count() from BENCHMARKSQL.BMSQL_HISTORY union all
select count(
) from BENCHMARKSQL.BMSQL_NEW_ORDER union all
select count() from BENCHMARKSQL.BMSQL_OORDER union all
select count(
) from BENCHMARKSQL.BMSQL_ORDER_LINE union all
select count() from BENCHMARKSQL.BMSQL_ITEM union all
select count(
) from BENCHMARKSQL.BMSQL_STOCK

4、装数据
[root@dmdb04 run]# pwd
/usr/local/benchmarksql/run
[root@dmdb04 run]# ./runLoader.sh props.dm numWarehouses 1

5、创建序列
–跑测试之前创建序列
create index ndx_customer_name on BENCHMARKSQL.BMSQL_customer (c_w_id, c_d_id, c_last, c_first);
create or replace procedure BENCHMARKSQL.createsequence
as
n int;
stmt1 varchar(200);
begin
select count(*)+1 into n from BMSQL_history;
if(n != 1) then
select max(hist_id) + 1 into n from BMSQL_history;
end if;
PRINT n;
stmt1:=‘create sequence hist_id_seq start with ‘||n||’ MAXVALUE 9223372036854775807 CACHE 50000;’;
EXECUTE IMMEDIATE stmt1;
end;
/
call BENCHMARKSQL.createsequence;
alter table BENCHMARKSQL.BMSQL_history modify hist_id integer default (BENCHMARKSQL.hist_id_seq.nextval);

6、执行测试工具
[root@dmdb04 run]# ./runBenchmark.sh props.dm

–测试完跑要是0
(Select w_id, w_ytd from bmsql_warehouse) except(select d_w_id, sum(d_ytd) from bmsql_district group by d_w_id);
(Select d_w_id, d_id, D_NEXT_O_ID - 1 from bmsql_district) except (select o_w_id, o_d_id, max(o_id) from bmsql_oorder group by o_w_id, o_d_id);
(Select d_w_id, d_id, D_NEXT_O_ID - 1 from bmsql_district) except (select no_w_id, no_d_id, max(no_o_id) from bmsql_new_order group by no_w_id, no_d_id);
select * from (select (count(no_o_id)-(max(no_o_id)-min(no_o_id)+1)) as diff from bmsql_new_order group by no_w_id, no_d_id) where diff != 0;
(select o_w_id, o_d_id, sum(o_ol_cnt) from bmsql_oorder group by o_w_id, o_d_id) except (select ol_w_id, ol_d_id, count(ol_o_id) from bmsql_order_line group by ol_w_id, ol_d_id);
(select d_w_id, sum(d_ytd) from bmsql_district group by d_w_id) except(Select w_id, w_ytd from bmsql_warehouse);

https://eco.dameng.com/

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/935545
推荐阅读
相关标签
  

闽ICP备14008679号