partition table test
create table p
(
order# number primary key,
order_date date,
data varchar2(30)
)
enable row movement
partition by range(order_date)
(
partition part_2007 values less than (date '2008-1-1'),
partition part_2008 values less than (date '2009-1-1')
)
/
create table c1
( order# number not null, -- the NOT NULL is necessary, even though part of the line# number, -- key
line# number,
data varchar2(30),
constraint c1_pk primary key(order#,line#),
constraint c1_fk_p foreign key(order#) references p
)
enable row movement
partition by reference(c1_fk_p)
;
insert into p (order#, order_date, data)
values ( 1,date '2007-1-1', 'order data' );
insert into p (order#, order_date, data)
values ( 2,date '2008-1-1', 'order data' );
SQL> insert into p (order#, order_date, data)
2 values ( 3,date '2009-1-1', 'order data' );
insert into p (order#, order_date, data)
values ( 3,date '2009-1-1', 'order data' )
ORA-14400: inserted partition key does not map to any partition
select * from p;
alter table p truncate partition part_2007;
SQL> select * from p;
ORDER# ORDER_DATE DATA
---------- ----------- ------------------------------
2 2008-1-1 order data
SQL>
SQL> truncate table p;
Table truncated
SQL> select * from p;
ORDER# ORDER_DATE DATA
---------- ----------- ------------------------------
SQL>
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/16179598/viewspace-626491/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- db2 partition table testDB2
- partition table and partition indexIndex
- 拆分Table 為Partition Table
- partition table(1)
- partition table(2)
- When to Partition a Table
- [Oracle] Partition table exchange Heap tableOracle
- Oracle 普通table 轉換為partition tableOracle
- create a partition table using a exsit table
- 分割槽表PARTITION table
- partition table update partition-key result in changing tablespace
- Interval Partition table 11G
- Oracle分割槽表(Partition Table)Oracle
- How to partition a non-partitioned table
- 分割槽表PARTITION table(轉)
- partition table中truncate應用
- mysql partition table use to_days bugMySql
- 關於partition table import的問題Import
- doesn't contain a valid partition tableAI
- add hash partition , default tablespace for patitioned table
- 【DB】Direct Path EXP Corrupts The Dump If An Empty Table Partition Exists
- Applying “Incremental Statistic” for Oracle Big Partition TableAPPREMOracle
- 壓縮table and index 對 space 的影響testIndex
- Data Warehouse Guide閱讀筆記(七):partition tableGUIIDE筆記
- ext4 lvreduce報錯superblock or the partition table is likely to be corruptVRBloC
- TiDB 原始碼閱讀系列文章(二十)Table PartitionTiDB原始碼
- 今天測試了一下update partition table的part key
- ESP32 編譯報錯 57) boot: no bootable app partitions in the partition table編譯bootAPP
- best practice of rebuild your partition table local index online by using: "update indexes"RebuildIndex
- PARTITION partition01
- PARTITION partition02
- PARTITION partition04
- ERROR 1114 (HY000): The table 'test1' is full 的解決Error
- Pruning、Reference Partition、Exchange Partition
- partition timestamp(0) not use partition
- 教你解決ghost win10開機出現invalid partition table的方法Win10
- [20191203]enq: ZA - add std audit table partition.txtENQ
- test