Quantcast
Channel: Michael Sass' Blog
Viewing all articles
Browse latest Browse all 6

Toad for DB2 – Remote Command Execution with qcexec on DB2 LUW

$
0
0

Toad for DB2 – Remote Command Execution with qcexec on DB2 LUW

Most of the DBAs have scripts which run over night or during weekend. Toad for DB2 remote command execution can be used to send scripts to the remote database server. Nowadays users can benefit from features like restart from syncpoint, embedded and save login information, log path specification if they are using Toad for DB2 remote command execution. In addition to that, Toad provides a walk through wizard generating the necessary scripts which is available as an icon or pull-down menu in the Toad editor window.

To use Toad for DB2 remote command execution an agent has to be installed on the remote DB2 LUW server. If that agent is available the DBA can easily send scripts from the Toad editor directly to the remote server to be executed via a DB2 command line call. Select the remote script execution wizard via

or the appropriate icon:

and the wizard starts:

The database and login information as well as the operating system type need to be added.

User-ID and password will be encrypted, and are not visible in the files on the remote server.

 

Specify a name for that job:

 

Specify the path for the DB2 export files:

 

The Toad options menu (Tools->Options->Database->DB2->LUW->General Utilities) allows you to specify a default directory for the utility files.

But on the Toad client machine only a local path can be specified. So it is advisable to select a directory for the export files on the remote server.

Specify where the execution script should be stored on the target server:

 

The transfer process is completed:

 

In the specified directory two files can be found:

-a sql-file which contains the actual SQL script

-an spf-file which contains the login information, database connection and some control parameters

 

The agent install directory, which is something like this
D:\Program Files\Quest Software\Toad for DB2 Agent v5.1 contains the server side batch execution program QcExec and an ini-file.


The ini-file can be used to specify a directory for the log file.

The default is the directory where the qcexec program resides.

A command line execution looks like this: QcExec  “d:\temp\AlterTableCustomer.spf”
It can be scheduled in the windows scheduler in any Cron or 3rd party scheduler.

If the script fails and needs to be restarted at a particular sync point the command line is:
 QcExec file.spf RESTART=
i.e.: QcExec file.spf RESTART=20

The log file contains all return codes of the executed commands.

If you want to change the auth-ID under which the script should be run, remember the connection info (User-ID and password) are already encrypted in the .spf-file, you can log in to the remote server with the User-ID under which the job should be run and execute it like:
QcExec file.spf IMPLICIT


More ...

Viewing all articles
Browse latest Browse all 6

Latest Images

Trending Articles





Latest Images