weekly interval partitioning [message #413090] |
Tue, 14 July 2009 06:08  |
behi
Messages: 12 Registered: June 2009
|
Junior Member |
|
|
Hi all,
I need to implement automatic table partitioning in Oracle 11g version, but partitioning interval should be on weekly basis(For every week).
I was able to perform this for Monthly and Yearly but not on weekly basis. Please suggest me how to perform this.
Thanks,
|
|
|
|
|
Re: weekly interval partitioning [message #413232 is a reply to message #413100] |
Tue, 14 July 2009 22:31   |
behi
Messages: 12 Registered: June 2009
|
Junior Member |
|
|
This is my code, it is works for Month:
CREATE TABLE TEST
( ID NUMBER(4,0),
C_DATE DATE
)
PARTITION BY RANGE (C_DATE)
INTERVAL (NUMTOYMINTERVAL(1,'MONTH'))
(PARTITION TEST_P1 VALUES LESS THAN
(TO_DATE(' 2009-07-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'));
if we replace interval statement as following, it will work for day too. but how I should define weekly partitions?
INTERVAL (NUMTODSINTERVAL(7,'day'))
[Updated on: Wed, 15 July 2009 01:30] by Moderator Report message to a moderator
|
|
|
|
|