Unload and Reload

TUC allows you to easily unload and reload a large number of tables while preserving data consistency and integrity.

Recording Datasets

Datasets created by the UNLOAD and RECORG DISCARD utilities are recorded to allow you to reload the data back to the tables. The datasets can also be loaded into tables with a different creator.

Editing Datasets

The online dialogs allow you to easily locate and edit datasets created by UNLOAD or REORG DISCARD. TUC analyzes the SYSPUNCH file and can identify columns positions in the records of flat files. You can make changes to rows in edit and sort records using existing index keys.

Unloading from image copies

TUC can generate UNLOAD statements to unload data from image copies. You can unload from the last image copy of each tablespace, or unload from an image copy taken before a specified log point.

Unloading tables with LOB and XML columns

TUC automatically generates UNLOAD statements with column specification if at least one table with a LOB or XML column is included. The column specification uses LOB files with a template named LOBFILE. The LOBFILE template is automatically generated when generating the default TEMPLATE member for the first time.

UNLOAD of tables with LOB and XML columns is faster when using SPANNED datasets. When using UNLOAD SPANNED YES, the column specification must include all LOB and XML columns at the end of the list. TUC automatically sorts the column list and generates an UNLOAD statement with column specification that includes LOB and XML columns at the end of the list.

Reloading Data

TUC can automatically identify SYSPUNCH files used by UNLOAD or REORG and prepare a single LOAD input file that includes all the LOAD statements desired to LOAD tables in a single step. The LOAD statements can be manipulated to force the usage of the selected LOAD options and the target table creator and name.

When replacing data in a tablespace with multiple tables, you must use the REPLACE option only for the first table and LOAD all the following tables with the RESUME option, otherwise if you REPLACE all tables, each LOAD will delete data for the entire tablespace and you will be left with only the last table being loaded. TUC identifies automatically the associated tablespace for each table and adjust the RESUME option accordingly.

Counting Records

NUMRECS indicates the number of input records that are to be loaded into the specified table. TUC attempt to read the SYSPUNCH dataset and detect the NUMRECS specification generated by the UNLOAD utility. If NUMRECS is not specified and the file is not allocated on a tape, TUC reads and counts the number of records. TUC automatically adds the missing NUMRECS specification to the LOAD statement.

Target Tables Compatibility

Target tables must exists with the same structure as specified in the LOAD column specification. TUC can identify if the target tables are missing or incompatible. TUC can exclude or create missing tables or add missing columns. The target tables are created based on the LOAD statement column specification. In addition, if the table includes a LOB column, TUC also automatically creates the auxiliary objects.

If you add columns to your source tables or drop and recreate the source tables with a different structure, you then also need to alter or drop and recreate the target tables to ensure that the structure of both the source and target tables remain the same. TUC can automatically generates DDL to ALTER ADD missing columns in accordance to the usage of the LOAD IGNOREFIELDS option.

TUC automatically removes the NULLIF specification in load statements for columns that have been defined as NOT NULL.

Sorting Data

TUC allows you to sort the data prior to load. Sort statements are generated automatically based on the column position specification and the currently created index columns. By default sort is generated using the clustering index. You can also sort by unique indexes to remove duplicates.

Since DB2 version 9, you can use the LOAD PRESORTED YES option. In this case, you can avoid sorting the clustering index. TUC automatically adds the PRESORTED YES option after sorting data by clustering order.

Go Back Up