Results 1 to 6 of 6

Thread: Alter DPF Key

  1. #1
    Join Date
    Oct 2010
    Posts
    94

    Unanswered: 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

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    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.

  3. #3
    Join Date
    Oct 2010
    Posts
    94
    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

  4. #4
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    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".

  5. #5
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    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

  6. #6
    Join Date
    Oct 2010
    Posts
    94
    Thanks much! You guys are the best!

    G

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •