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博客 ” ,链接:https://blog.itpub.net/26224914/viewspace-2214927/ ,如需转载,请注明出处,否则将追究法律责任。