db2 如何模擬indobt transactions 用到的指令碼

flywiththewind發表於2018-09-26

 kill -9 13536 

 

 db2 "create database partition group dpg1t5 on dbpartitionnums(1 to 5)"

 

 db2 "create tablespace data in database partition group dpg1t5"

 

 db2 drop table t20180926


 db2 "create table t20180926(id int not null primary key generated by default as identity (start with 1 increment by 1 no cache no order no maxvalue),name varchar(10)) distribute by hash(id) in data"

 


 i=0;while ((i<100000)); do db2 "insert into t20180926(name) values(varchar(int(rand()*1000))||'abc'||char(int(rand()*1000)))"; i=$((i+1)); done

 

 

 db2 "select dbpartitionnum(id),count(*) from t20180926 group by dbpartitionnum(id) order by dbpartitionnum(id)"


 

 [dpfinst@db22 ~]$ db2 "select dbpartitionnum(id),count(*) from t20180926 group by dbpartitionnum(id) order by dbpartitionnum(id)"


1           2          

----------- -----------

          1         492

          2         510

          3         517

          4         475

          5         513


  5 record(s) selected.

  

  

  


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26224914/viewspace-2214927/,如需轉載,請註明出處,否則將追究法律責任。

相關文章