You are on page 1of 5

Data movement options available in DB2 V9.

5
There are various data movement options available in DB2 V9.5. The following table provides an overview of the data movement tools and utilities available to you. Use this table as a guide to help you determine which data movement options might best suit your needs. Table 1. Data movement options available in DB2 V9.5 Utility name Purpose Cross platform compatible Load utility To efficiently move large quantities of data into newly created tables, or into tables that already contain data. Yes This utility is best suited to situations where performance is your primary concern. This utility can be used as an alternative to the import utility. It is faster then the import utility because it writes formatted pages directly into the database rather than using SQL INSERTS. In addition, the load utility allows you the option to not log the data or use the COPY option to save a copy of the loaded data. Load operations can fully exploit resources, such as CPUs and memory on SMP and MPP environments. Loading data

Best practice usage

References

Utility name

db2move Using the db2move utility with the COPY option, allows you to copy schema templates (with or without data) from a source database to a target database or move an entire schema from a source database to a target database. Using the db2move utility with the IMPORT or EXPORT option facilitates the movement of a large numbers of tables between DB2 databases. Yes When used with the COPY option, the source and the target database must be different. The COPY option is useful in making schema templates. Use the IMPORT or EXPORT option for cloning databases when there is no support for cross-platform backup and restore operations. The IMPORT and EXPORT options are used in conjunction with the db2look command.

Purpose

Cross platform compatible

Best practice usage

References Utility name Purpose Cross platform compatible

Copying a schema Imported table re-creation Import utility

To insert data from an external file into a table, hierarchy, view, or nickname Yes The import utility can be a good alternative to the load utility in the following situations:

Best practice usage

where the target table is a view the target table has constraints and you don't want the target table to be put in the Set Integrity Pending state the target table has triggers and you want them fired

References

Importing data

Utility name Purpose Cross platform compatible

Export utility To export data from a database to one of several external file formats. The data can then be imported or loaded at a later time. Yes This utility is best suited in situations where you want to store data in an external file, to either process it further or move data to another table. High Performance Unload (HPU) is an alternative, however, it must be purchased separately. Export supports XML columns. Exporting data

Best practice usage

References Utility name

ADMIN_COPY_SCHEMA procedure Allows you to make a copy of all the objects in a single schema and re-create those objects in a new schema. This copy operation can be performed with or without data, within a database. Yes This utility is useful for making schema templates. It is also useful if you want to experiment with a schema (for example, try out new indexes) without impacting the source schema's behavior. The key differences between the ADMIN_COPY_SCHEMA procedure and the db2move utility are:

Purpose

Cross platform compatible

Best practice usage

The ADMIN_COPY_SCHEMA procedure is used on a single database while the db2move utility is used across databases The db2move utility fails when invoked if it cannot create a physical object such as a table or index. The ADMIN_COPY_SCHEMA procedure logs errors and continues. The ADMIN_COPY_SCHEMA procedure uses load from cursor to move data from one schema to the other. The db2move utility uses a remote load, similar to a load from

Utility name

Export utility cursor, which pulls in the data from the source database.

References Utility name

Copying a schema Restore utility with the REDIRECT option and the GENERATE SCRIPT option To copy an entire database from one system to another using a script from an existing backup image. Limited. See References This utility is best suited in situations where a backup image exists.

Purpose Cross platform compatible Best practice usage

References

Performing a redirected restore using an automatically generated script Backup and restore operations between different operating systems and hardware platforms

Utility name Purpose Cross platform compatible

db2relocatedb - Relocate database command To rename a database, or relocate a database or part of a database to the same system or a different system. No

Best practice usage

This utility can be used for situations where a backup and restore could be time consuming. This utility is an alternative to using backup and restore to move or create copies of databases. It also provides a quick method of cloning a database for alternative environments such as testing. It can be used to move table space containers to a new set of storage devices

References

db2relocatedb - Relocate database command

Utility name Purpose Cross platform compatible

Split mirror To create a clone, standby, or backup database. No


Best practice usage

create a standby system in case of a primary failure to reduce down time move backup operations away from a live production machine onto a split database provides a quick method of cloning a database for alternate environments, such as testing only DMS table spaces can be backed up on the split version of the database usually used in conjunction with some flashcopy technology provided with storage systems an alternative is to issue a file copy once the database is suspended, however this duplicates the amount of storage for the database

Considerations

References Reference topic ( Feedback )

High availability through online split mirror and suspended I/O support

http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/topic/com.ibm.db2.luw.admin.dm.doc/do c/r0024482.html

You might also like