Range partition overlap

This is a discussion on Range partition overlap within the ibm-db2 forums in Other Databases category; What is the syntax to overlap partitions? Lets assume I want a year split amount 4 months (3 partitions for a year) and later adding an additional set of partitions for every 6 months. Plus giving us the option to detach old partitions. For example: CREATE TABLE orders(id INT, shipdate DATE, …) PARTITION BY RANGE(shipdate) ( PARTITION m12y05 STARTING MINVALUE, PARTITION m4y06 STARTING '1/1/2006', PARTITION m8y06 STARTING '5/1/2006', PARTITION m12y06 STARTING '9/1/2006' ENDING ‘12/31/2006' ) ======================== -- Detach old data detach partition m12y05 ============================ -- Later applying additional partitions Alter table orders Add Partition ( Partition s6y06 starting '...

Go Back   Database Forum > Other Databases > ibm-db2

Database Forums

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-18-2008, 06:28 PM
Default Range partition overlap

What is the syntax to overlap partitions? Lets assume I want a year
split amount 4 months (3 partitions for a year) and later adding an
additional set of partitions for every 6 months. Plus giving us the
option to detach old partitions.

For example:
CREATE TABLE orders(id INT, shipdate DATE, …)
PARTITION BY RANGE(shipdate)
(
PARTITION m12y05 STARTING MINVALUE,
PARTITION m4y06 STARTING '1/1/2006',
PARTITION m8y06 STARTING '5/1/2006',
PARTITION m12y06 STARTING '9/1/2006'
ENDING ‘12/31/2006'
)

========================

-- Detach old data
detach partition m12y05

============================

-- Later applying additional partitions

Alter table orders
Add Partition
(
Partition s6y06 starting '1/1/2006',
Partition s12y06 starting '7/1/2006' ending '12/31/2006'
)

Reply With Quote
  #2  
Old 08-19-2008, 06:28 PM
Default Re: Range partition overlap

Justin,

I do not understand your question.
Partitions do not overlap. That's an oxymoron.

Your details request on the other hand seems to not imply that question
either. To the bets of my knowledge I don't think anything prevents you
from extending a range partitioned any which way you like....

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Reply With Quote
  #3  
Old 08-25-2008, 03:36 PM
Default Re: Range partition overlap


Hi Serge,

I think you answered my question. But, I do not understand your point
in extending partitions.

If partitions cannot overlap, that is fine. Is it possible to add a
partition?

For example, I have two years of data (2007 and 2008). The partition
is set-up by year. What is the default when 2009 comes to the table?
Is this the process of extending a partition?

In the process, I would like to detach 2007 data to slower disk
(different tablespace).


On Aug 19, 5:28*pm, Serge Rielau wrote:
> Justin,
>
> I do not understand your question.
> Partitions do not overlap. That's an oxymoron.
>
> Your details request on the other hand seems to not imply that question
> either. To the bets of my knowledge I don't think anything prevents you
> from extending a range partitioned any which way you like....
>
> Cheers
> Serge
> --
> Serge Rielau
> DB2 Solutions Development
> IBM Toronto Lab


Reply With Quote
  #4  
Old 08-26-2008, 08:31 AM
Default Re: Range partition overlap

Justin wrote:
> Hi Serge,
>
> I think you answered my question. But, I do not understand your point
> in extending partitions.
>
> If partitions cannot overlap, that is fine. Is it possible to add a
> partition?
>
> For example, I have two years of data (2007 and 2008). The partition
> is set-up by year. What is the default when 2009 comes to the table?
> Is this the process of extending a partition?
>
> In the process, I would like to detach 2007 data to slower disk
> (different tablespace).
>
>
> On Aug 19, 5:28 pm, Serge Rielau wrote:
>> Justin,
>>
>> I do not understand your question.
>> Partitions do not overlap. That's an oxymoron.
>>
>> Your details request on the other hand seems to not imply that question
>> either. To the bets of my knowledge I don't think anything prevents you
>> from extending a range partitioned any which way you like....

Yes, you can ATTACH new partitions. Take a look at the ALTER TABLE
statement.

Cheers
Serge


--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Reply With Quote
Reply


Thread Tools
Display Modes



All times are GMT -4. The time now is 09:23 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Integrated by bbpixel2008 :: jvbPlugin R1013.368.1

Search Engine Friendly URLs by vBSEO 3.1.0
vB Ad Management by =RedTyger=
In an effort to better serve ads to our visitors, cookies are used on Mydatabasesupport.com. For more information, check out our Privacy Policy.