Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interval Partition By Hour

Bdub122-OracleMar 19 2013 — edited Mar 19 2013
I want to interval partition this table every 4 hours. Does this seem right?

CREATE TABLE "BDub122"."EVENT"
( "EVENT_ID" NUMBER(20,0),
"END_TIME" TIMESTAMP (3)
) PCTFREE 10 PCTUSED 40 INITRANS 1
STORAGE(
BUFFER_POOL DEFAULT
FLASH_CACHE DEFAULT
CELL_FLASH_CACHE DEFAULT)
TABLESPACE "EVENT_DATA"
PARTITION BY RANGE ("END_TIME")
INTERVAL(NUMTODSINTERVAL(4, 'HOUR')) -- Partition every 4 hours
(PARTITION "2013-03-19 00:00:00" VALUES LESS THAN (TO_DATE
('2013-03-19 00', 'YYYY-MM-DD hh24', 'NLS_CALENDAR=GREGORIAN'))
SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 NOLOGGING
STORAGE(INITIAL 8M NEXT 1M MINEXTENTS 1 PCTINCREASE 0 FREELISTS 1
FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT
CELL_FLASH_CACHE DEFAULT)
TABLESPACE "EVENT_DATA",
PARTITION "2013-03-19 04:00:00" VALUES LESS THAN (TO_DATE
('2013-03-19 04', 'YYYY-MM-DD hh24', 'NLS_CALENDAR=GREGORIAN'))
SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 NOLOGGING
STORAGE(INITIAL 8M NEXT 1M MINEXTENTS 1 PCTINCREASE 0 FREELISTS 1
FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT
CELL_FLASH_CACHE DEFAULT)
TABLESPACE "EVENT_DATA"
);

The table creates fine, but I want:
1.] To verify that I have the syntax right to accomplish what I'm trying to do.
2.] Ask if there's a better way? . . .although if the syntax is right this should work pretty well

Thank you

Edited by: BDub122 on Mar 19, 2013 8:33 AM
This post has been answered by unknown-7404 on Mar 19 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 16 2013
Added on Mar 19 2013
4 comments
2,278 views