DB2 数据库创建表分区
DB2数据库按月创建表分区
本文主要记录在DB2数据库中创建表分区
VARCHAR类型的列作为分区依据
create table xxtable (
lie1 varchar(20),
lie2 varchar(20)not null
)
partition by (lie2)
(
part "2000" starting(minvalue) ending ('19991231') ,
part "200001" starting('20000101') ending ('20000131') ,
part "200002" starting('20000201') ending ('20000230') ,
……
e)
TIMESTAMP 类型的列作为分区的依据
create table xxtable (
lie1 varchar(20),
lie2 timestamp not null
)
partition by (lie2)
(
starting minvalue,
starting '2000-01-01' ending '2010-01-01' every 1 month ,
ending maxvalue
)