!!! 日和周的是 NUMTODSINTERVAL,年的和月的是 NUMTOYMINTERVAL !!!
一、 自动创建 天 的分区 (7天 = 1周)
PARTITION BY RANGE (TOC) INTERVAL (NUMTODSINTERVAL(7,'day'))
(partition "PART_T01" values less than (TO_DATE('2021-11-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')));
二、自动创建 月 的分区
PARTITION BY RANGE ("ENTR_SEND_TIME") INTERVAL (NUMTOYMINTERVAL(1, 'MONTH'))
(PARTITION "PART_T01" VALUES LESS THAN (TO_DATE(' 2021-07-20 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')) SEGMENT CREATION IMMEDIATE
三、自动创建 年 的分区
PARTITION BY RANGE ("ENTR_SEND_TIME") INTERVAL (NUMTOYMINTERVAL(1, 'year'))
(PARTITION "PART_T01" VALUES LESS THAN (TO_DATE(' 2021-07-20 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')) SEGMENT CREATION IMMEDIATE