The UNLOAD and RELOAD commands are similar to the previous DATAUNLOAD and DATALOAD commands. One difference is that they can be applied not only to tables, but also to views or dbspaces. The major difference is that the data must be (un)loaded in a system defined format. Also, UNLOAD unloads the rows sorted according to the first index created for that table. This first index is also known as the clustering index. This index is identified by a value of F or W in the column CLUSTER in the SYSTEM.SYSINDEXES table. The data is ordered by the clustering index during UNLOAD. If no indexes exist on this table, the rows are unloaded in no particular order.
In addition to containing a record for each row in the table, the UNLOAD output file also has records containing information about the table and indexes. This information is needed by the RELOAD function. UNLOAD does not unload any indexes, only the statements to recreate these indexes. No SELECT statement is used to unload the table.
Purpose
The main purpose of UNLOAD and RELOAD is reorganization for a better index. You can also choose this method if you want to change dbspace characteristics, such as PCTINDEX. However, you cannot change the characteristics of tables or columns while running this type of reorganization.
Another reason can be for balancing the I/O load between different DASD. The table or dbspace can be moved to another storage pool that owns extents on another DASD volume.
Enhanced Control Center reorganization and maintenance tools support you in the different activities of a database administrator. The Control Center command SQLREORG offers a menu-driven interface and makes use of the DB2 UNLOAD and RELOAD functions. With the Control Center SQLREORG option you can choose to change the data definition values. For example, you can choose to have a different dbspace name, PCTINDEX value, or change the size of the dbspace.
For a complete description of SQLREORG, refer to the DB2 for VM Control Center Operations Guide or DB2 for VSE Control Center Operations Guide.