Release Notes


12.8 db2move

The db2move tool now has two addtional options, --aw and --sn. Full documentation for this tool follows:

Database Movement Tool

This tool facilitates the movement of large numbers of tables between DB2 databases located on workstations. The tool queries the system catalog tables for a particular database and compiles a list of all user tables. It then exports these tables in PC/IXF format. The PC/IXF files can be imported or loaded to another local DB2 database on the same system, or can be transferred to another workstation platform and imported or loaded to a DB2 database on that platform.

Note:
Tables with structured type columns are not moved when this tool is used.

Authorization

This tool calls the DB2 export, import, and load APIs, depending on the action requested by the user. Therefore, the requesting user ID must have the correct authorization required by those APIs, or the request will fail.

Command Syntax

                            .-------------------------.
                            V                         |
>>-db2move--dbname--action----+---------------------+-+--------><
                              +--tc--table-creators-+
                              +--tn--table-names----+
                              +--sn--schema names---+
                              +--io--import-option--+
                              +--lo--load-option----+
                              +--l--lobpaths--------+
                              +--u--userid----------+
                              +--p--password--------+
                              '--aw-----------------'
 
 

Command Parameters

dbname
Name of the database.

action
Must be one of: EXPORT, IMPORT, or LOAD.

-tc
table-creators. The default is all creators.

This is an EXPORT action only. If specified, only those tables created by the creators listed with this option are exported. If not specified, the default is to use all creators. When specifying multiple creators, each must be separated by commas; no blanks are allowed between creator IDs. The maximum number of creators that can be specified is 10. This option can be used with the "-tn" and "-sn" options to select the tables for export.

An asterisk (*) can be used as a wildcard character that can be placed anywhere in the string.

-tn
table-names. The default is all user tables.

This is an EXPORT action only. If specified, only those tables whose names match exactly those in the specified string are exported. If not specified, the default is to use all user tables. When specifying multiple table names, each must be separated by commas; no blanks are allowed between table names. The maximum number of table names that can be specified is 10. This option can be used with the "-tc" and "-sn" options to select the tables for export. db2move will only export those tables whose names are matched with specified table names and whose creators are matched with specified table creators.

An asterisk (*) can be used as a wildcard character that can be placed anywhere in the string.

-sn
schema names. The default is ALL SCHEMAS.

This is an EXPORT action only. If specified, only those tables whose schemas match exactly those in the specified string are exported. If not specified, the default is to use all schemas. When specifying multiple schema names, each must be separated by commas; no blanks are allowed between schema names. The maximum number of schema names that can be specified is 10. This option can be used with the "-tc" and "-tn" options to select the tables for export. db2move will only export those tables whose names are matched with specified table names, whose schemas are matched with specific table schemas, and whose creators are matched with specified table creators.

An asterisk (*) can be used as a wildcard character that can be placed anywhere in the string.

Note:
Schema names less than 8 characters in length are padded to be 8 characters long. For example, if you want to include the schemas "AUSER" and "BUSER"and use the wildcard character, you must specify -sn *USER*.

-io
import-option. The default is REPLACE_CREATE.

Valid options are INSERT, INSERT_UPDATE, REPLACE, CREATE, and REPLACE_CREATE.

-lo
load-option. The default is INSERT.

Valid options are INSERT and REPLACE.

-l
lobpaths. The default is the current directory.

This option specifies the absolute path names where LOB files are created (as part of EXPORT) or searched for (as part of IMPORT or LOAD). When specifying multiple LOB paths, each must be separated by commas; no blanks are allowed between LOB paths. If the first path runs out of space (during EXPORT), or the files are not found in the path (during IMPORT or LOAD), the second path will be used, and so on.

If the action is EXPORT, and LOB paths are specified, all files in the LOB path directories are deleted, the directories are removed, and new directories are created. If not specified, the current directory is used for the LOB path.

-u
userid. The default is the logged on user ID.

Both user ID and password are optional. However, if one is specified, the other must be specified. If the command is run on a client connecting to a remote server, user ID and password should be specified.

-p
password. The default is the logged on password.

Both user ID and password are optional. However, if one is specified, the other must be specified. If the command is run on a client connecting to a remote server, user ID and password should be specified.

-aw
allow warnings.

Used for the EXPORT action only. If this option is specified, then any tables that receive warnings during export will be included in the db2move.lst file. If the option is omitted, then any tables that cause warnings during export are not included in the db2move.lst file. A table's .ixf file and .msg file are generated regardless of whether or not this option is used.

Examples

Usage Notes

This tool exports, imports, or loads user-created tables. If a database is to be duplicated from one operating system to another operating system, db2move facilitates the movement of the tables. It is also necessary to move all other objects associated with the tables, such as aliases, views, triggers, user-defined functions, and so on. db2look (DB2 Statistics and DDL Extraction Tool; see the Command Reference) can facilitate the movement of some of these objects by extracting the data definition language (DDL) statements from the database.

When export, import, or load APIs are called by db2move, the FileTypeMod parameter is set to lobsinfile. That is, LOB data is kept in separate files from PC/IXF files. There are 26 000 file names available for LOB files.

The LOAD action must be run locally on the machine where the database and the data file reside. When the load API is called by db2move, the CopyTargetList parameter is set to NULL; that is, no copying is done. If logretain is on, the load operation cannot be rolled forward later. The table space where the loaded tables reside is placed in backup pending state and is not accessible. A full database backup, or a table space backup, is required to take the table space out of backup pending state.

When issued on a Version 5.2 client against a Version 6 database, this tool does not support table or column names that are greater than 18 characters in length.

Files Required/Generated When Using EXPORT:

Files Required/Generated When Using IMPORT:

Files Required/Generated When Using LOAD:


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]