I have a scenario where it is necessary to execute some scripts daily.Is it possible to automate the execution via some tools.?

  • What kind of scripts are you running? – Kate Paulk Jun 9 '14 at 20:28
  • How is this related to software quality or testing? Maybe you can elaborate your use case a bit more. – Niels van Reijmersdal Jun 10 '14 at 10:51

Yes, it's possible and in two different ways.


Using the Administrative Task Scheduled (ATS) built inside db2 to execute scheduled operations.

Command Line

the db2 command can also read command from a file specified from the command line

The two solution have both pros and cons: the setup of the AST solution requires administrative privileges on the db while the command line doesn't need changes on the database, on the other side the command line version requires to be scheduled using an external cron daemon while the AST use the scheduling service offered by db2


If you would like kind of automated tool which is not only capable of executing queries but also report execution time, perform assertions on returned result set, re-using return values for further queries, etc. I would recommend to look into Apache JMeter which can talk to DB2 instance via JDBC (assuming that you have relevant JDBC driver in JMeter classpath) and execute queries/scripts through JDBC Request Sampler provided.

As an option it'll allow to do performance testing of your DB2 instance by sending concurrent queries and collecting performance metrics.

See The Real Secret to Building a Database Test Plan With JMeter guide for more details.


From my side I can suggest you to use SoapUI tool. It allows you to manage your DB tests and extend them with scripting using Groovy. Or you can use Groovy and built in API for SQL handling and implement your own framework.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.