oracle partition
drop table sales1;
--範圍必須越來越大
CREATE TABLE sales1(
year int ,
month int,
day int,
fee number)
PARTITION by range (year,month,day)
(
partition sale1 values less than(1999,02,01) tablespace ts1,
partition sale2 values less than(2000,01,01) tablespace ts2,
partition sale3 values less than(2001,01,01) tablespace ts3,
partition sale4 values less than(2002,01,01) tablespace ts4,
partition sale5 values less than(MAXVALUE,MAXVALUE,MAXVALUE) tablespace ts5
);
--第一種索引
drop index idx_sales1;
create index idx_sales1 on sales1(year);
--第二種索引
drop index idx_sales1;
--ORA-14021: 必須指定所有列的 MAXVALUE
--ORA-14010: 不可以指定索引分割槽的此物理屬性
create index idx_sales1 on sales1(year)
global partition by range(year)
(
partition sale1 values less than(1999) tablespace tsi1,
partition sale2 values less than(2000) tablespace tsi2,
partition sale3 values less than(2001) tablespace tsi3,
partition sale4 values less than(2002) tablespace tsi4,
partition sale5 values less than(MAXVALUE) tablespace tsi5
);
--第三種索引
drop index idx_sales1;
--ORA-14024: LOCAL 索引的分割槽數必須等於基本表的分割槽數(索引分割槽名可以與表分割槽名不一致,不過索引資料怎麼儲存呢?)
CREATE INDEX idx_sales1 ON SALES1 (YEAR)
TABLESPACE EXAMPLE LOCAL
(
PARTITION aSALE1 tablespace tsi1,
PARTITION aSALE2 tablespace tsi2,
PARTITION aSALE3 tablespace tsi3,
PARTITION aSALE4 tablespace tsi4)
;
insert into sales1 values(1999,01,01,1);
--null 插入到maxvalue表空間。
insert into sales1 values(null,null,null,0);
--ORA-14400: 插入的分割槽關鍵字未對映到任何分割槽
insert into sales1 values(2004,01,01,1);
commit;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/235507/viewspace-566752/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle partition的方法Oracle
- oracle partition by 語法Oracle
- oracle partition by group by,詳解partition by和group by對比Oracle
- 自動SPLIT ORACLE PARTITIONOracle
- oracle分割槽partition及分割槽索引partition index(一)Oracle索引Index
- oracle composite partition組合分割槽_composite partition rangeOracle
- [Oracle] Partition table exchange Heap tableOracle
- Oracle 分割槽(partition)技術Oracle
- Oracle分割槽表(Partition Table)Oracle
- 【Oracle】ORA-14400: inserted partition key does not map to any partitionOracle
- oracle reference partition引用分割槽(一)Oracle
- oracle list partition列表分割槽(一)Oracle
- oracle分割槽及分割槽索引partition_partition index_維護(一)Oracle索引Index
- oracle分割槽及分割槽索引partition_partition index_維護(二)Oracle索引Index
- oracle分割槽及分割槽索引partition_partition index_維護(三)Oracle索引Index
- oracle分割槽及分割槽索引partition_partition index_維護(四)Oracle索引Index
- partition table and partition indexIndex
- PARTITION partition01
- PARTITION partition02
- PARTITION partition04
- Oracle Partition 分割槽詳細總結Oracle
- Oracle drop,truncate partition 索引失效 實驗Oracle索引
- Oracle 普通table 轉換為partition tableOracle
- oracle hash partition雜湊分割槽(一)Oracle
- oracle分割槽及分割槽索引partition_partition index_維護(五)_快捷方法Oracle索引Index
- Pruning、Reference Partition、Exchange Partition
- partition timestamp(0) not use partition
- Oracle使用over()partition by刪除重複記錄Oracle
- 聊聊Oracle 11g中的Reference Partition(上)Oracle
- 聊聊Oracle 11g中的Reference Partition(下)Oracle
- ORACLE 範圍分割槽 partition-range分割槽Oracle
- Oracle Interval Partition 自動分割槽表-實驗Oracle
- Oracle的分割槽修剪介紹:Partition PruningOracle
- Applying “Incremental Statistic” for Oracle Big Partition TableAPPREMOracle
- oracle hash partition雜湊分割槽(二)_操作限制Oracle
- oracle11g_system partition系統分割槽Oracle
- Oracle查詢Interval partition分割槽表內資料Oracle
- oracle組合分割槽系列二(composite hash partition)Oracle