8.1.3 Unloading a table

Organization of this subsection
(1) What is unloading a table?
(2) Migrating data into another table
(3) Modifying table partitioning conditions
(4) Using an unload data file as pdload's input data file or with a UAP
(5) Unloading a table with LOB columns or abstract data type columns provided by a plug-in (LOB attribute)
(6) Unloading a table for which a character set has been defined
(7) Unloading compressed tables
(8) Unloading tables with the FIX attribute for which reserved columns are defined
(9) Unloading a table using a UOC
(10) Using a utility special unit

(1) What is unloading a table?

Table reorganization involves saving the table data into a file and then storing the data from the file back into the table. This process for saving table data in a file is called unloading a table.

You can unload a table in units of tables or RDAREAs (applicable to row-partitioned tables).

The figure below provides an overview of unloading a table.

Figure 8-6 Overview of unloading a table

[Figure]

(2) Migrating data into another table

To migrate data into another table, first save the table data to an unload data file and then reload the data from the unload data file into the other table. Note that the target table must have the same attribute (FIX or non-FIX) and column definitions (such as number of columns and their data types) as the source table. However, data migration may still be possible even when their definitions are different if you use pdload's input data file (-W option specified) as the unload data. When you reload compressed tables to separate tables, do not use the unload data files that are output during table reorganization because their data is compressed. Instead, use the files that are output during table unload processing.

The figure below provides an overview of migrating data to another table.

Figure 8-7 Overview of migrating data into another table

[Figure]

(3) Modifying table partitioning conditions

To modify table partitioning conditions, first save the table data to an unload data file, then modify the table partitioning conditions, and reload the data from the unload data file back into the table.

The figure below provides an overview of modifying table partitioning conditions.

Figure 8-8 Overview of modifying table partitioning conditions

[Figure]

(4) Using an unload data file as pdload's input data file or with a UAP

To use an unload data file as pdload's input data file or with a UAP, specify the -W option during unload operation.

(5) Unloading a table with LOB columns or abstract data type columns provided by a plug-in (LOB attribute)

Unload a LOB column structure base table and the LOB columns at the same time. You cannot unload only the LOB columns.

(6) Unloading a table for which a character set has been defined

When a table for which a character set has been defined is unloaded, pdrorg performs character code conversion regardless of whether a UOC is used. In this case, pdrorg converts the data in a character set-defined column to the default character set (character codes specified in the pdsetup command) and then outputs the data to the unload data file.

(7) Unloading compressed tables

To unload compressed tables, pdrorg expands data in the compressed columns and then outputs the data to unload files.

(8) Unloading tables with the FIX attribute for which reserved columns are defined

You can also unload tables with the FIX attribute for which reserved columns are defined. Note that reserved columns are not output to the pdload unload file that is created during execution of pdrorg with the -w option specified.

(9) Unloading a table using a UOC

For details about unloading tables using a UOC, see 8.1.2 (8) Reorganization using a UOC.

(10) Using a utility special unit

For details about how to use a utility special unit, see 8.1.2 Reorganizing a table.