Execute a Batch Processor script on a target subsystem. For example, use this command to execute a Batch Processor script or specifically to execute a recovery script to undo changes that were made by the 'zowe dbm-db2 execute compare-script' command. If execution of the script fails, you can execute it again using the 'script-section' or 'restart' options. You can edit the script and make changes before you execute or restart it.
Usage
zowe dbm-db2 execute script <local-input-bp-script-filename> [options]
Positional Arguments
Options
-
--target-db2
| --td
(string)
- Specifies the target Db2 subsystem ID where you want to execute the script. If the option is not specified, the target subsystem is identified by the first .CONNECT statement in the script. The target-db2 option value takes precedence.
-
--script-section
| --ss
(string)
-
Identifies the location in the script where you want to begin execution.
The following options are valid:
name - Begin execution of the specific section and process all subsequent statements up to the next section.
A section is a '.SYSTEM <name>' statement, where <name> identifies a logical grouping of statements such as UNLOADS or SQLDDL. 'source' is an alias for UNLOADS. 'target' is an alias for SQLDDL.
number - Begin execution after the specific sync point (.SYNC <number> statement) and process all statements up to the end of the script.
name, number - Begin execution of the specific script section beginning from the sync point (.SYNC <number> statement) within the section and process all subsequent statements up to the next section.
-
--restart
| -r
(string)
-
Specifies the location in the script where you want to restart execution. The effects of previous successful script statement executions remain.
The following restart options are valid:
new - Restart execution of the script at the first statement.
token - Restart execution of the script at the location that is recorded in the specified token and that was returned from a previous execution failure.
name, token - Restart execution of the script at the location in the restart section that is recorded in the specified token and that was returned from a prior execution failure.
A section is a Batch Processor '.SYSTEM <name>' statement, where <name> identifies a logical grouping of statements such as UNLOADS or SQLDDL. 'source' is an alias for UNLOADS. 'target' is an alias for SQLDDL.
-
--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
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
-
Execute a recovery script:
zowe dbm-db2 execute script recovery.txt
-
Execute a script on the 'TEST' Db2 subsystem:
zowe dbm-db2 execute script script001.txt --target-db2 TEST
-
Execute only the SQLDDL section of a script. The first .CONNECT statement in the script identifies the target subsystem where the script is executed. Execution begins at the .SYSTEM SQLDDL statement and ends at the next .SYSTEM statement in the script:
zowe dbm-db2 execute script script001.txt ––script-section SQLDDL
-
Execute a script beginning from the sync point 10 (.SYNC 10 statement) to the end of the script:
zowe dbm-db2 execute script script001.txt ––script-section 10
-
Execute only the target (SQLDDL) section of the script starting at sync point 20:
zowe dbm-db2 execute script script001.txt ––script-section target,20
-
Restart execution of a script from the beginning:
zowe dbm-db2 execute script script001.txt ––restart new
-
Restart execution of a script at the location specified in the token. The restart token is returned by a previous 'zowe dbm-db2 execute command' failure as part of the terminal output and in the error file:
zowe dbm-db2 execute script script001.txt ––restart 78A724A48DA5185D06FD140F6780D6FA
-
Restart execution at the last successful sync point recorded in the restart token up to the end of the target (SQLDDL) section:
zowe dbm-db2 execute script script001.txt ––restart target,78A724A48DA5185D06FD140F6780D6FA