create table test_emp
(
ID NUMBER(20) not null,
EMP_CODE VARCHAR2(30),
EMP_name varchar2(30),
CREATED_TM DATE not null
)
partition by range (CREATED_TM)
interval (numtoyminterval(1,'MONTH'))
(
partition P_201405 values less than (TO_DATE(' 2014-06-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
partition P_201406 values less than (TO_DATE(' 2014-07-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
partition P_201407 values less than (TO_DATE(' 2014-08-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
);
alter table test_emp
add constraint PK_TT_GATHERING primary key (CREATED_TM, ID) using index LOCAL;
create index IDX_GATHERING_01 on test_emp (EMP_CODE) LOCAL;
(
ID NUMBER(20) not null,
EMP_CODE VARCHAR2(30),
EMP_name varchar2(30),
CREATED_TM DATE not null
)
partition by range (CREATED_TM)
interval (numtoyminterval(1,'MONTH'))
(
partition P_201405 values less than (TO_DATE(' 2014-06-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
partition P_201406 values less than (TO_DATE(' 2014-07-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
partition P_201407 values less than (TO_DATE(' 2014-08-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
);
alter table test_emp
add constraint PK_TT_GATHERING primary key (CREATED_TM, ID) using index LOCAL;
create index IDX_GATHERING_01 on test_emp (EMP_CODE) LOCAL;