data movement options available in db2 v9.5

8
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 Load utility Purpose To efficiently move large quantities of data into newly created tables, or into tables that already contain data. Cross platform compatible Yes Best practice usage 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. References Loading data

Upload: udaykiranrajitha-kammala

Post on 25-Jul-2015

25 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Data Movement Options Available in DB2 V9.5

Data movement options available in DB2 V9.5There 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 Load utility

PurposeTo efficiently move large quantities of data into newly created tables, or into tables that already contain data.

Cross platform compatible Yes

Best practice usage

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.

References Loading data

Page 2: Data Movement Options Available in DB2 V9.5

Utility name db2move

Purpose

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.

Cross platform compatible Yes

Best practice usage

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.

References Copying a schema Imported table re-creation

Utility name Import utility

PurposeTo insert data from an external file into a table, hierarchy, view, or nickname

Cross platform compatible Yes

Best practice usage

The import utility can be a good alternative to the load utility in the following situations:

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

Page 3: Data Movement Options Available in DB2 V9.5

Utility name Export utility

PurposeTo export data from a database to one of several external file formats. The data can then be imported or loaded at a later time.

Cross platform compatible Yes

Best practice usage

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.

References Exporting data

Utility name ADMIN_COPY_SCHEMA procedure

Purpose

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.

Cross platform compatible Yes

Best practice usage 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:

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

Page 4: Data Movement Options Available in DB2 V9.5

Utility name Export utility

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

References Copying a schema

Utility nameRestore utility with the REDIRECT option

and the GENERATE SCRIPT option

PurposeTo copy an entire database from one system to another using a script from an existing backup image.

Cross platform compatible Limited. See References

Best practice usageThis utility is best suited in situations where a backup image exists.

References

Performing a redirected restore using an automatically generated script

Backup and restore operations between different operating systems and hardware platforms

Utility name db2relocatedb - Relocate database command

PurposeTo rename a database, or relocate a database or part of a database to the same system or a different system.

Cross platform compatible 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

Page 5: Data Movement Options Available in DB2 V9.5

Utility name Split mirror

Purpose To create a clone, standby, or backup database.

Cross platform compatible 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

Considerations

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

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

Reference topic

( Feedback )

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