- 论坛徽章:
- 0
|
hash分区表数据分布不平衡的问题,急、急、急!!!!!!!!
本人建立银行历史流水表的脚本如下,然后用insert into wyl_pub_jnl_2_history select * from ..语句将历史数据
插入该表中,但数据并未均匀分布在七个表空间里,在表空间userpart4上分布的数据时其它表空间的2倍,具体空间占用
情况如下表2,请各位高手指点迷津,急!!!,本人在线等待。
CREATE TABLE wyl_pub_jnl_2_history
(
agt_inst char(4) NOT NULL ,
host_seqno integer DEFAULT 0 NOT NULL ,
clt_seqno char( NOT NULL ,
tran_date integer NOT NULL ,
tran_time char(14) NOT NULL ,
corr_date integer,
tran_abbr char(20),
tran_no char(4),
cstm_no1 char(14),
cstm_no2 char(14),
acc_id1 integer,
acc_id2 integer,
onebk_acc1 char(25),
onebk_acc2 char(25),
onebk_serno1 integer,
onebk_serno2 integer,
acc1 char(25) NOT NULL ,
acc2 char(25),
acc_name1 char(40) NOT NULL ,
acc_name2 char(40),
curr_type1 char(2) NOT NULL ,
curr_type2 char(2),
amt decimal(16,2) DEFAULT 0 NOT NULL ,
pk_no1 integer,
pk_no2 integer,
norm_int decimal(16,2) DEFAULT 0 NOT NULL ,
kpint decimal(16,2) DEFAULT 0 NOT NULL ,
fee_amt decimal(16,2) DEFAULT 0 NOT NULL ,
onebk_tran_flag char(2),
proc_flag char(2),
dr_cr_flag char(1),
csh_tsf_flag char(1),
tlr char(4),
check_tlr char(4),
summ_no integer,
summ char(30),
auth_no integer,
flag char( NOT NULL
) INITRANS 50 STORAGE(FREELISTS 5 FREELIST GROUPS 2)
partition by range (tran_date) subpartition by hash ( acc1 )
( partition wyl_pub_jnl_2_history_1 values less than ( 38066 )
(subpartition sub_pub_jnl_2_history11 tablespace userpart1,
subpartition sub_pub_jnl_2_history12 tablespace userpart2,
subpartition sub_pub_jnl_2_history13 tablespace userpart3,
subpartition sub_pub_jnl_2_history14 tablespace userpart4,
subpartition sub_pub_jnl_2_history15 tablespace userpart5,
subpartition sub_pub_jnl_2_history16 tablespace userpart7,
subpartition sub_pub_jnl_2_history17 tablespace userpart8 ),
partition wyl_pub_jnl_2_history_2 values less than ( 38158 )
(subpartition sub_pub_jnl_2_history21 tablespace userpart1,
subpartition sub_pub_jnl_2_history22 tablespace userpart2,
subpartition sub_pub_jnl_2_history23 tablespace userpart3,
subpartition sub_pub_jnl_2_history24 tablespace userpart4,
subpartition sub_pub_jnl_2_history25 tablespace userpart5,
subpartition sub_pub_jnl_2_history26 tablespace userpart7,
subpartition sub_pub_jnl_2_history27 tablespace userpart8 ),
partition wyl_pub_jnl_2_history_3 values less than ( 38250 )
(subpartition sub_pub_jnl_2_history31 tablespace userpart1,
subpartition sub_pub_jnl_2_history32 tablespace userpart2,
subpartition sub_pub_jnl_2_history33 tablespace userpart3,
subpartition sub_pub_jnl_2_history34 tablespace userpart4,
subpartition sub_pub_jnl_2_history35 tablespace userpart5,
subpartition sub_pub_jnl_2_history36 tablespace userpart7,
subpartition sub_pub_jnl_2_history37 tablespace userpart8 ),
partition wyl_pub_jnl_2_history_4 values less than ( maxvalue )
(subpartition sub_pub_jnl_2_history41 tablespace userpart1,
subpartition sub_pub_jnl_2_history42 tablespace userpart2,
subpartition sub_pub_jnl_2_history43 tablespace userpart3,
subpartition sub_pub_jnl_2_history44 tablespace userpart4,
subpartition sub_pub_jnl_2_history45 tablespace userpart5,
subpartition sub_pub_jnl_2_history46 tablespace userpart7,
subpartition sub_pub_jnl_2_history47 tablespace userpart8 )
);
表1(空间占用情况)
分区 表空间名 大小(M)
SUB_PUB_JNL_2_HISTORY11 USERPART1 2240
SUB_PUB_JNL_2_HISTORY12 USERPART2 2176
SUB_PUB_JNL_2_HISTORY13 USERPART3 2176
SUB_PUB_JNL_2_HISTORY14 USERPART4 4341
SUB_PUB_JNL_2_HISTORY15 USERPART5 2176
SUB_PUB_JNL_2_HISTORY16 USERPART7 2176
SUB_PUB_JNL_2_HISTORY17 USERPART8 2176
SUB_PUB_JNL_2_HISTORY21 USERPART1 1536
SUB_PUB_JNL_2_HISTORY22 USERPART2 1536
SUB_PUB_JNL_2_HISTORY23 USERPART3 1536
SUB_PUB_JNL_2_HISTORY24 USERPART4 3072
SUB_PUB_JNL_2_HISTORY25 USERPART5 1536
SUB_PUB_JNL_2_HISTORY26 USERPART7 1536
SUB_PUB_JNL_2_HISTORY27 USERPART8 1536
SUB_PUB_JNL_2_HISTORY31 USERPART1 392
SUB_PUB_JNL_2_HISTORY32 USERPART2 392
SUB_PUB_JNL_2_HISTORY33 USERPART3 392
SUB_PUB_JNL_2_HISTORY34 USERPART4 776
SUB_PUB_JNL_2_HISTORY35 USERPART5 392
SUB_PUB_JNL_2_HISTORY36 USERPART7 392
SUB_PUB_JNL_2_HISTORY37 USERPART8 392
SUB_PUB_JNL_2_HISTORY41 USERPART1 .06
SUB_PUB_JNL_2_HISTORY42 USERPART2 .06
SUB_PUB_JNL_2_HISTORY43 USERPART3 .06
SUB_PUB_JNL_2_HISTORY44 USERPART4 .06
SUB_PUB_JNL_2_HISTORY45 USERPART5 .06
SUB_PUB_JNL_2_HISTORY46 USERPART7 .06
SUB_PUB_JNL_2_HISTORY47 USERPART8 .06 |
|