Scheduling command scripts

You can save the commands that are generated by a task assistant to a script and schedule a time to run the script.

For example, a common practice is to run scripts in the middle of the night or on a production server that other products cannot connect to. You can use either the Job Manager or the DB2 Command Line Processor (CLP) shell interface. With either method, you effectively leave the task assistant, and the commands are not run through the task assistant.

Job Manager

You can schedule your command scripts to run as jobs by using the Job Manager from the SQL and XQuery editor. If you click Edit in the Command section of a task assistant, the SQL and XQuery editor opens. You can change the commands or leave them as is. When you are satisfied with your commands, click the Icon image of the Job Manager (Job Manager) icon in the editor to open the Job Manager to a new job, with the script already attached.

To use the Job Manager, ensure that your IBM® Data Studio client is configured to access the Data Studio web console.

DB2 Command Line Processor (CLP) shell interface

You can run your command scripts or schedule them to run in batches on the server through the DB2 Command Line Processor (CLP) shell interface. If you click Save in the Command section of a task assistant, the commands are saved to a script that is compatible to be run directly from the data server. When you click Save, the commands are displayed in the Save the Commands to a Script window.

The commands are modified as needed so that they can be run from a data server. In the window, you can edit the commands, including any comments that have been inserted, and specify the file name, path, and location for saving the script. You can save the script to the data server file system, which might be remote, or to the local file system.

Tip: The Secure Shell (SSH) protocol must be set up to browse for and save files to a remote server on a Windows operating system. If this protocol is not set up, you can save the script to the local server and then manually transfer the file by using a file transfer mechanism, such as FTP.

Feedback