请教增加分区的问题
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 选项