Nice to meet you db2batch !
I have been using db2batch for a while now. The more I use it, the more I like it. It can give you very useful information about your query that can help you tune it.  It can give you execution / run time information, run it under certain optimization level, give you explain information, database snapshot , dbm snapshot, table snapshot information while the query is running.  There is one caviar to it, by default db2batch execute the query in RR isolation level. This is not desirable if the query is long running and is run against production system as it may cause locking issue and might even hang the system. So I suggest you change the isolation level of the db2batch to CS  if you are going to run it against production or against any system which is busy.  You can do so by binding the db2batch.bnd found on /sqllib/bin directory with isolation cs :
db2 bind db2batch.bnd isolation cs blocking all grant publicdb2batch does a good job of benchmarking the sqls. Â There are several options you can use in db2batch, I am not going to mention all of it here. You can find it on DB2 manuals, but here is a basic one I always use :
db2batch -d rajudb -f  sqlfile1.sql  -r result_sqlfile1.txt  -o p 1 e 2
This will connect to the database rajudb , run the sql in the file sqlfil1.sql and send the output to result_sqlfile1.txt . The -o options enables me to specify the level of performance detail and explain done on the table. Refer to the manual to find details about it.Â
Here is sample output I got from the above run :Â
Db2batch can work in both a single partition database and in a multiple partition database, so you don’t have to worry about the results if the query spans multiple partitions.Â
Â