请教增加分区的问题

kentenjoy 2006-06-06 09:47:12
tablespace都是存在的,用了
create tablespace taba datafile 'd:\oracle\oradata\oratest\datafile1.dbf' size 1m;
create tablespace tabb datafile 'd:\oracle\oradata\oratest\datafile2.dbf' size 1m;
create tablespace tabc datafile 'd:\oracle\oradata\oratest\datafile3.dbf' size 1m;
create tablespace tabd datafile 'd:\oracle\oradata\oratest\datafile4.dbf' size 1m;
create tablespace tabe datafile 'd:\oracle\oradata\oratest\datafile5.dbf' size 1m;

用这句建表:
create table sales(
invoice_no number,
sale_year int not null,
sale_month int not null,
sale_day int not null)
partition by range(sale_year)
(partition sales_q1 values less than(1999)
tablespace taba
storage(initial 100k next 100k minextents 1 maxextents unlimited pctincrease 0),
partition sales_q2 values less than(2000)
tablespace tabb
storage(initial 100k next 100k minextents 1 maxextents unlimited pctincrease 0),
partition sales_q3 values less than(2001)
tablespace tabc
storage(initial 100k next 100k minextents 1 maxextents unlimited pctincrease 0),
partition sales_q4 values less than(2002)
tablespace tabd
storage(initial 100k next 100k minextents 1 maxextents unlimited pctincrease 0)
);



用这句建索引
create index month_ix on sales(sale_year)
global partition by range(sale_year)
(partition sales_q1 values less than(1999),
partition sales_q2 values less than(2000),
partition sales_q3 values less than(2001),
partition sales_q4 values less than(maxvalue)
);


用这句增加分区报错
alter table sales
add patition sale_q5 values
less than(1998) tablespace tabe;

报错为:
ERROR 位于第 2 行:
ORA-01735: 非法的 ALTER TABLE 选项
...全文
228 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
perchant 2006-06-06
  • 打赏
  • 举报
回复
首先,partition拼错了,其次,less than的值只能比最后一个分区大,不能比最后一个分区小,如果一定要加,就另建一张表再同步数据吧

17,377

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧