Generate a script to migrate Db2 object definitions (DDL) and data from a source subsystem to a target subsystem. You can specify which objects to include and apply changes to the objects as part of the migration. To execute the script, use the 'zowe dbm execute migration-script' command.
For details about command usage for automation, see DBM-Db2 samples at https://github.com/BroadcomMFD/dbm-db2-for-zowe-cli
Usage
zowe dbm-db2 prepare migration [options]
Options
-
--object
| -o
(string)
-
Specifies the Db2 objects that you want to migrate. Use the optional include syntax to include related Db2 objects.
Format: see object-file description.
Note: The --object and --object-file options are mutually exclusive.
-
--object-file
| --of
(string)
-
Specifies the local input file that contains a list of Db2 objects, separated by a semicolon, that you want to migrate. Use the optional include syntax to include related Db2 objects.
Format:
<object-type> <object-name> [include(<related-object-type>,...)];
The required clause <object-type> <object-name> identifies the specific Db2 (base) object:
STOGROUP <name>
DATABASE <name>
TABLESPACE <dbname.name>
TABLE <schema.name>
INDEX <schema.name>
VIEW <schema.name>
ALIAS <schema.name>
SYNONYM <schema.name>
MQT <schema.name>
SEQUENCE <schema.name>
TRIGGER <schema.name>
FUNCTION <schema.name[.version]>
PROCEDURE <schema.name[.version]>
The optional clause include(<related-object-type>,...) identifies one or more, comma separated related object types that you want to include in the object list. You can specify STOGROUP, DATABASE, TABLESPACE, TABLE, INDEX, VIEW, SYNONYM, MQT-ALL, TRIGGER, ROUTINE, PARENTS, CHILDREN, and ALL.
Example:
table sysibm.systables include (tablespace, database, index);
database db1 include(children);
Note: The --object and --object-file options are mutually exclusive.
-
--change-set
| --cs
(string)
-
Specifies the creator and name of an existing RC/Migrator global change set to be used to modify Db2 object attributes when preparing objects for migration.
Format:
<change-set-creator.change-set-name>
For more information about global change services, see the RC/Migrator documentation at https://techdocs.broadcom.com/db2rcmig.
Note: If change-set and change-set-file are both specified, specifications in change-set-file take precedence.
-
--change-set-file
| --csf
(string)
-
Specifies the name of the local input file that contains the global change specifications to modify Db2 object attributes when preparing for migration.
Format:
<object-attribute> <from-value> <to-value>
The <object-attribute> consists of four characters. The first two characters identify the object type. The last two characters identify the specific attribute. Wildcard characters are supported in the <from-value> and <to-value>. The first occurrence in multiple specifications for the same <object-attribute> has the highest precedence.
For a list of global change set attributes, see the RC/Migrator documentation at https://techdocs.broadcom.com/db2rcmig.
Example:
The following example demonstrates changes to table’s schema (creator) and tablespace names:
TBCR TEST% PROD%
TBTS TESTTS% PRODTS%
Note: If change-set and change-set-file are both specified, specifications in change-set-file take precedence.
-
--output-migrate-script
| --oms
(string)
-
--output-ddl-file
| --odf
(string)
-
--modification
| -m
(string)
-
Identifies a named set of server-managed default parameter values that control the execution behavior of the zowe dbm-db2 commands. For example, you can use a modification to identify a set of default values that differ from the set of values that are normally used.
For more information about using the modification option, see the DBM Data Service documentation at https://techdocs.broadcom.com/db2mgmt.
-
--error-file
| --ef
(string)
-
Specifies the local output error file in YAML format that contains basic execution information, connection details, dbm-db2 profile parameters, used arguments, and errors that occurred during execution of the command.
Default value: error.log
Required Options
Profile Options
Base Connection Options
-
--host
| -H
(string)
- Host name of service on the mainframe.
-
--port
| -P
(number)
- Port number of service on the mainframe.
-
--user
| -u
(string)
- User name to authenticate to service on the mainframe.
-
--password
| --pass
| --pw
(string)
- Password to authenticate to service on the mainframe.
-
--reject-unauthorized
| --ru
(boolean)
-
--token-type
| --tt
(string)
- The type of token to get and use for the API. Omit this option to use the default token type, which is provided by 'zowe auth login'.
-
--token-value
| --tv
(string)
- The value of the token to pass to the API.
-
--cert-file
(local file path)
- The file path to a certificate file to use for authentication
-
--cert-key-file
(local file path)
- The file path to a certificate key file to use for authentication
Examples