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 > Alter DPF Key

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-02-10, 13:31
getback0 getback0 is offline
Registered User
 
Join Date: Oct 2010
Posts: 73
Alter DPF Key

Hello,

I have a fairly bulky table with a DPF key X that I believe is not an optimal choice. The table is defined on a multi-partition database group. Can I change the DPF key to column Y? If yes, what does it entail - dropping and recreating the table????

As always, thanks for the guidance!

G
Reply With Quote
  #2 (permalink)  
Old 11-02-10, 14:19
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally Posted by getback0 View Post
what does it entail - dropping and recreating the table????
Yes, you will have to re-create the table with the new partitioning key.
Reply With Quote
  #3 (permalink)  
Old 11-02-10, 16:08
getback0 getback0 is offline
Registered User
 
Join Date: Oct 2010
Posts: 73
Thanks n_i! although, I want to make sure I detailed my request correctly - I am looking for the procedure to alter the DPF key and not the partitioning key (starting 9.x, I understand these two are different entities).

G
Reply With Quote
  #4 (permalink)  
Old 11-02-10, 16:53
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
To be precise, it should be called "distribution key". You are correct that "partitioning key" applies to partitioned tables, but I meant to say "distribution key".
Reply With Quote
  #5 (permalink)  
Old 11-02-10, 16:57
Marcus_A Marcus_A is online now
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
I would do a db2look on the table (or whole database) to see the existing table DDL. You want to change the "DISTRIBUTE BY HASH" column.

Export the existing data in del format (not IXF) before you drop the table and then load it back after you recreate the table with new DISTRIBUTE BY HASH column.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #6 (permalink)  
Old 11-02-10, 17:17
getback0 getback0 is offline
Registered User
 
Join Date: Oct 2010
Posts: 73
Thanks much! You guys are the best!

G
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