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 by 語法Oracle
- oracle partition by group by,詳解partition by和group by對比Oracle
- Oracle Partition 分割槽詳細總結Oracle
- Oracle查詢Interval partition分割槽表內資料Oracle
- Partition Pruning和Partition-Wise Joins
- Clique Partition
- 分割槽Partition
- B. Range and Partition
- 7.74 DATAOBJ_TO_PARTITIONOBJ
- 86. Partition List
- sql(oracle)資料處理實用總結開窗函式(over partition)使用SQLOracle函式
- 7.73 DATAOBJ_TO_MAT_PARTITIONOBJ
- 3-Partition 問題
- Peace or partition? Cyprus - Espresso EconomistEspresso
- Codeforces 1948E Clique Partition
- Partition|Disk Utility 如何分割磁碟
- ROWNUMBER() OVER( PARTITION BY COL1
- 分割槽partition知識點
- Spark學習——分割槽Partition數Spark
- [LeetCode] 416. Partition Equal Subset SumLeetCode
- 分割槽函式Partition By的基本用法函式
- PostgreSQL DBA(94) - PG 12 Improving Partition(Select)SQL
- PostgreSQL DBA(93) - PG 12 Improving Partition(Insert)SQL
- Kafka分割槽分配策略(Partition Assignment Strategy)Kafka
- PostgreSQL DBA(95) - PG 12 Partition(out of shared memory)SQL
- How to Add a New Disk new partition in centos7CentOS
- 分割槽函式partition by的基本用法【轉載】函式
- [20191203]enq: ZA - add std audit table partition.txtENQ
- Hadoop中java.lang.ClassCastException: partition解決方法HadoopJavaASTException
- TiDB 原始碼閱讀系列文章(二十)Table PartitionTiDB原始碼
- QOJ #1280.Fibonacci Partition/Fibonacci性質大雜燴
- (二)《SQL進階教程》學習記錄--GROUP BY、PARTITION BYSQL
- ext4 lvreduce報錯superblock or the partition table is likely to be corruptVRBloC
- codeforce 686div3 F Array Partition單調棧
- MySQL 千萬級資料表 partition 實戰應用MySql
- 使用parted建立大分割槽時 mkpart Warning: The resulting partition is not properly
- 從簡單的快速排序說起-Partition-ThreePartition-TopK排序TopK
- row_number() OVER (PARTITION BY COL1 ORDER BY COL2)
- 通過MOVE PARTITION來回收已經使用的空間