RE: Invoking RUNSTATS dynamically from an application

RE: Invoking RUNSTATS dynamically from an application

 

  


We had faced a similar problem last year, as our application also supports
multiple databases. Runstats cannot be invoked using JDBC. We ended up using
Runtime.exec() to do the runstats for DB2.

I am not sure whether you can invoke runstats from within a db2 stored proc,
but I would guess not.

- Nihar

-----Original Message-----
From: Bill Province
To: DB2 Lazy DBA
Sent: 1/22/2003 5:41 PM
Subject: Invoking RUNSTATS dynamically from an application

Hi Gurus,

We have mechanisms in our application where we will generate
statistics for our tables at strategic points. Currently, for Sybase,
SQLServer, and Oracle, we are able to do this within stored procedures.
A bit of reading of the documentation for DB2 suggests that this is
simply not possible within DB2. Am I not reading this correctly?

What is the best way to invoke RUNSTATS or the equivalent within our
application? My current options are from within stored procedures, or
from within a Java application using JDBC. I know that in a worst-case
scenario, I could always do this by kicking off a shell process that
runs a script, but I would really prefer to not take that route.

Thanks.

-- Bill Province
DB2 & UDB email list listserv db2-l LazyDBA home page