By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,850 Members | 1,771 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,850 IT Pros & Developers. It's quick & easy.

Running the same script across multiple DB2 databases, instances and servers

P: n/a
We have a requirement to run a query on all of the DB2 databses on a
regular basis.

Obviously, doing this manually is going to be a waste of several
people's time.

The ideal solution would be to run a process from a workstation.

If this was a Sybase database, we could use ISQL in command mode, using
a command string like
isql -S target_server -U query-login -P query-passwrod -I script.sql -O
server_YYYYMMDD.out

We'd then have another process that would collate the output files and
perform the analysis needed.

Is there a similar facility for DB2?

I'd like to canvass everyone for suggestions or how they do similar
operations.

Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
In article <11**********************@g49g2000cwa.googlegroups .com>,
byrocat (bd******@sympatico.ca) says...
We have a requirement to run a query on all of the DB2 databses on a
regular basis.

Obviously, doing this manually is going to be a waste of several
people's time.

The ideal solution would be to run a process from a workstation.

If this was a Sybase database, we could use ISQL in command mode, using
a command string like
isql -S target_server -U query-login -P query-passwrod -I script.sql -O
server_YYYYMMDD.out

We'd then have another process that would collate the output files and
perform the analysis needed.

Is there a similar facility for DB2?

I'd like to canvass everyone for suggestions or how they do similar
operations.


Hi,

You can use a cripting language to get this doen or just use plain
BAT files. I use a REXX script to get this kind of things done. You
can download several REXX interpreters for free. I prefer ooRexx
which you can download from
http://sourceforge.net/project/showf...roup_id=119701

You can also use a .bat file with commands like this:

db2 connect to %1 user %2 using %3
db2 -tf script.sql > %1_YYMMDD.out
db2 connect reset

and run it with 'runsql dbname user password' froma DB2 Command
window.

You need to catalog the database and node before running these
commands but that's a one-time job.

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.