The amount of data stored in a row-partitioned table increases over time. As a result, it becomes desirable to erase old data. However, if the data registration date/time, for example, is specified as the partitioning key, simply deleting old data cannot make the RDAREA that was storing the old data available for reuse. In the past, to reuse an RDAREA that was storing old data, you had to perform the following operations:
While these operations were being performed, jobs that access the table being modified had to be stopped temporarily. Because all data had to first be unloaded from the table that was to be modified, and then had to be reloaded, a long time was required for these operations, and the impact on jobs that were stopped could be significant.
Now, by using the ALTER TABLE to change the partitioning storage conditions of a row-partitioned table, you can reduce the amount of time it takes to make an RDAREA reusable.
Figure 13-12 provides an overview of changing partitioning storage conditions (in the case of boundary value specification).
Figure 13-12 Overview of changing partitioning storage conditions (in the case of boundary value specification)
Therefore, in step 1, all that is needed is to unload the data from R01 and R02 and then, after the partitioning storage conditions have been changed, to reload the data from R02 only. In step 2, all that is needed is to unload the data from R04 and load data into R04 and R01 after the partitioning storage conditions have been changed. It was also possible to delete the contents of R01 in step 1. If it turned out that R04 did not contain any data for 2003 and beyond, there would be no need for unloading and reloading, and thus the RDAREA configuration could be modified quite quickly. This makes it possible to recycle and reuse RDAREAs that store data that increases in volume as new ascending key values are added.
Figure 13-13 provides an overview of changing partitioning storage conditions (in the case of storage condition specification).
Figure 13-13 Overview of changing partitioning storage conditions (in the case of storage condition specification)