create table p(id number)
partition by range(id)
(partition p1 values less than(100) tablespace t1,
partition p2 values less than(200) tablespace t2,
partition p3 values less than(300) tablespace t3)
2、添加分区
alter table p add partition p4 values less than (400) tablespace t4
3、清除分区数据
alter table p trunc partition p1
4、删除分区
alter table p drop partition p1
可以的,比如有分区表如下:
create table test(
msg_id VARCHAR2(16),
result INTEGER,
ts VARCHAR2(17),
ts_time TIMESTAMP(6),
insert_time DATE)
partition by range (TS_TIME)
(
partition P20180110 values less than (TIMESTAMP' 2018-01-11 00:00:00')
tablespace USERS
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64K next 1M
minextents 1
maxextents unlimited
)
)
如果想增加分区:
alter table test add partition P20180112 values less than (to_date('20180113 00:00:00','yyyymmdd hh24:mi:ss'))欢迎分享,转载请注明来源:内存溢出
评论列表(0条)