Section 12.11. Summary


12.11. Summary

In this chapter you were introduced to the different data movement utilities that come with DB2. The utilities support the following file formats: DEL, ASC, IXF, WSF, and CURSOR.

The Export utility extracts data from a table or view into a file. Only a few options are available in the export command. However, at a minimum, you should specify the output file name (where exported data is stored), its file format, the message file name, and a SELECT statement.

The import utility, on the other hand, inserts data into a specified table or view from a file. You can choose to import to an existing or new table (or view). By default, DB2 only issues one COMMIT at the very end of the import operation. In case of failure during the import, all the changes will be rolled back, and you need to restart the import from the beginning. Alternatively, you can use options such as commitcount, restartcount, and skipcount to enable the ability of restarting an import.

The load utility is another method to insert data into a specified table or view and is much faster. The utility formats the data pages while bypassing DB2 buffering and logging. The utility is composed of four phases: load, build, delete, and index copy. You can check the load message file or the status of the table or use the load query command to monitor the load operation.

The db2move utility can be used to move more than one table using just one command. The utility lets you specify the action: export, import, or load. This utility comes in very handy when many tables need to be moved.

The RUNSTATS, REORG, and REORGCHK utilities are very important data maintenance utilities that should be performed regularly to ensure that the most optimal data access plans are used.



Understanding DB2(R. Learning Visually with Examples)
Understanding DB2: Learning Visually with Examples (2nd Edition)
ISBN: 0131580183
EAN: 2147483647
Year: 2004
Pages: 313

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net