IBM Books

Administration Guide

How Data Is Redistributed Across Database Partitions

The Data Redistribution operation is done on the set of tables in the specified nodegroup of a database. (The application must be connected to the database at the catalog database partition before executing the operation.) The utility uses both the source partitioning map and the target partitioning map to identify which hash partitions have been assigned to a new location (that is, a new database partition number). All rows that correspond to a partition that has a new location are moved from the database partition specified in the source partitioning map to the database partition specified in the target partitioning map.

The Data Redistribution utility does the following:

  1. Obtains a new partitioning map ID for the target partitioning map, and inserts it into the SYSCAT.PARTITIONMAPS catalog view.

  2. Updates the REBALANCE_PMAP_ID column in the SYSCAT.NODEGROUPS catalog view for the nodegroup with the new partitioning map ID.

  3. Adds any new database partitions to the SYSCAT.NODEGROUPDEF catalog view.

  4. Sets the IN_USE column in the SYSCAT.NODEGROUPDEF catalog view to 'D' for any database partition that is to be dropped.

  5. Does a COMMIT for the catalog updates.

  6. Creates database files for all new database partitions.

  7. Redistributes the data on a table-by-table basis for every table in the nodegroup. This is described in "How Data Is Redistributed in Tables".

  8. Deletes database files and deletes entries in the SYSCAT.NODEGROUPDEF catalog view for database partitions that were previously marked to be dropped.

  9. Updates the nodegroup record in the SYSCAT.NODEGROUPS catalog view to set PMAP_ID to the value of REBALANCE_PMAP_ID and REBALANCE_PMAP_ID to NULL.

  10. Deletes the old partitioning map from the SYSCAT.PARTITIONMAPS catalog view.

  11. Does a COMMIT for all changes.

[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]