DB2 UDB 7.1 fp3 AIX 4.3.3 db2 command processor and crontab

DB2 UDB 7.1 fp3 AIX 4.3.3 db2 command processor and crontab

Post by Bernard Dhoog » Tue, 11 Dec 2001 21:06:48



Assume following entry in crontab:

50 0 * * 0 rm -f /var/tmp/1;su - inst2  -c 'echo "connect to
t1;\\nreorg table sysibm.syssection;" >/var/tmp/1;db2 -vtsf
/var/tmp/1'

inst2 is the owner of an instance with a database t1 in it

When executing within crontab it fails:

connect to t1
DB21016E  The Command Line Processor encountered a system error while
sending
the command to the backend process.

Executing on a terminal the content of the file /var/tmp/1 will work
as expected, the content being:

connect to t1;
reorg table sysibm.syssection;

How to let the command line processor work in crontab?

 
 
 

DB2 UDB 7.1 fp3 AIX 4.3.3 db2 command processor and crontab

Post by Dirk Lerne » Tue, 11 Dec 2001 22:27:13


Hi,

why not writing all in a shell-script and just execute this shellsrcipt in
your crontab?

#!/bin/bash (or whatelse)

rm /your/tmp-file
db2 connect to t1 > /your/tmp-file
db2 reorg table sysibm.syssection >> /your/tmp-file

and so on.

It works fine for me :)

Dirk