创建一个分区表
create table p_table(month varchar2(10),prov varchar2(10),cost_fee number)
partition by range(month) --范围分区
(partition p1 values less than ('201403'),
partition p2 values less than ('201406'),
partition p3 values less than ('201409'),
partition p4 values less than (maxvalue));
--插入记录
insert into p_table values('201402','aaa',111);
insert into p_table values('201403','b',2);
insert into p_table values('201404','c',3);
insert into p_table values('201405','d',4);
insert into p_table values('201406','e',5);
insert into p_table values('201407','f',6);
select * from p_table partition(p2);--查询分区表的第一个分区的内容
select * from user_extents where segment_name='P_TABLE' --查看表的分区信息
--为分区表建立索引
create index index_p_month on p_table(month) local (partition p1,partition p2,partition p3,partition p4);--索引的分区数必须等于基本表的分区数
追问也就是没办法为单个分区单独创建分区了?