If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Adding a parition with ALTER

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-19-08, 11:04
deadmanthedba deadmanthedba is offline
Registered User
 
Join Date: Jun 2008
Posts: 16
Adding a parition with ALTER

Hello,

Is it possible to add a partition to existing partitioned index using ALTER and also changing the limit key in between?

Example:
Current:
TS - SAMPTS1
IX - SAMPIX1
Partitioned - 3 partitions
LIMITKEY - 1111, 2222 & 3333

I want to add a new partition between 2222 & 3333, say 2999

To be:
TS - SAMPTS1
IX - SAMPIX1
Partitioned - 4 partitions
LIMITKEY - 1111, 2222, 2999 & 3333. I have tried it using multiple steps, UNLOAD-DROP-CREATE-LOAD... but, is it possible with ALTER & REORG alone?

DB2 for z/OS V8

Steve Wawzynzak
Reply With Quote
  #2 (permalink)  
Old 09-19-08, 12:10
umayer umayer is offline
Registered User
 
Join Date: Dec 2005
Posts: 273
It might be possible if you first alter the limit of partition 3 from 3333 to 2999, then add a new partition with limit 3333 and do a reorg afterwards.
Reply With Quote
  #3 (permalink)  
Old 09-19-08, 12:21
deadmanthedba deadmanthedba is offline
Registered User
 
Join Date: Jun 2008
Posts: 16
umayer,

You are right! We can alter the limitkey then add a new partition. But, I was wondering if you can do it in just one-step, as it is done in table-controlled partitions.


Steve Wawzynzak
Reply With Quote
  #4 (permalink)  
Old 09-20-08, 05:27
Peter.Vanroose Peter.Vanroose is offline
Registered User
 
Join Date: Sep 2004
Location: Belgium
Posts: 1,079
Quote:
Originally Posted by deadmanthedba
I was wondering if you can do it in just one step
No; the basic idea with adding partitions is that you want to gradually allow for new (i.e., larger) values in new partitions, without having to create those (empty) partitions already from the beginning.
Otherwise said, your design should anticipate future partitions.
Of course, the design can be modified (that's what you want to do); but that requires more steps.
__________________
--_Peter Vanroose,
__IBM Certified Database Administrator, DB2 9 for z/OS
__IBM Certified Application Developer
__ABIS Training and Consulting
__http://www.abis.be/
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On