Interval partitioning is an extension to range partitioning.
You can use interval partition to automatically add new partitions.
Sample
CREATE TABLE mypart_table
(
TARIH DATE NOT NULL,
KOD NUMBER(5) NOT NULL,
ALAN VARCHAR2(600 BYTE),
)
PARTITION BY RANGE (TARIH)
(
PARTITION mypart_table_201303 VALUES LESS THAN (TO_DATE('2013-04-01', 'YYYY-MM-DD')),
PARTITION mypart_table_201304 VALUES LESS THAN (TO_DATE('2013-05-01', 'YYYY-MM-DD')),
PARTITION mypart_table_201305 VALUES LESS THAN (TO_DATE('2013-06-01', 'YYYY-MM-DD')),
PARTITION mypart_table_201306 VALUES LESS THAN (TO_DATE('2013-07-01', 'YYYY-MM-DD'))
)
;
CREATE INDEX BANKDB.IDX_mypart_table_01 ON mypart_table
(TARIH, KOD)
LOCAL;
--add partition interval 1 day
alter table mypart_table set INTERVAL( NUMTODSINTERVAL(1,'DAY'));
You can't modify interval partitions. You can disable and enable again.
--disable interval
ALTER TABLE mypart_table SET INTERVAL ();
When to Use Range or Interval Partitioning
Hiç yorum yok:
Yorum Gönder