The redistribution of a file across a node group is a fairly simple process.
You can use the Change Physical File (CHGPF) command to specify either a new node group for a file or a new partitioning key for a file. The CHGPF command can be used to make a local file into a distributed file, to make a distributed file into a local file, or to redistribute a distributed file either across a different set of nodes or with a different partitioning key.
You should be aware that the process of redistribution might involve the movement of nearly every record in the file. For very large files, this can be a long process during which the data in the file is unavailable. You should not do file redistribution often or without proper planning.
To change a local physical file into a distributed file, you must specify the node group (NODGRP) and partitioning key (PTNKEY) parameters on the CHGPF command. Issuing this command changes the file to be distributed across the nodes in the node group, and any existing data is also distributed using the partitioning key specified on the PTNKEY parameter.
To change a distributed file into a local file, you must specify NODGRP(*NONE) on the CHGPF command. This deletes all the remote pieces of the file and forces all of the data back to the local system.
To change the partitioning key of a distributed file, specify the wanted fields on the PTNKEY parameter of the CHGPF command. This does not affect which systems the file is distributed over. It does cause all of the data to be redistributed, because the hashing algorithm needs to be applied to a new partitioning key.
To specify a new set of systems over which the file should be distributed, specify a node group name on the node group (NODGRP) parameter of the CHGPF command. This results in the file being distributed over this new set of systems. You can specify a new partitioning key on the PTNKEY parameter. If the PTNKEY parameter is not specified or if *SAME is specified, the existing partitioning key is used.
The CHGPF command handles creating new pieces of the file if the node group had new systems added to it. The CHGPF command handles deleting pieces of the file if a system is not in the new node group. Note that if you want to delete and re-create a node group and then use the CRTPF command to redistribute the file, you must specify the node group name on the NODGRP parameter of the CHGPF command, even if the node group name is the same as the one that was used when the file was first created. This indicates that you do want the system to look at the node group and to redistribute the file. However, if you specified a node group on the NODGRP parameter and the system recognized that it is identical to the node group currently stored in the file, then no redistribution occurs unless you also specified PTNKEY.
For files with referential constraints, if you want to use the CHGPF command to make the parent file and the dependent file distributed files, you should do the following tasks: