Is it possible to call the DB2 RUNSTATS (to collect statistics) command in a script?
I tried this:
SQL(‘datastore’, ‘RUNSTATS ON TABLE dbowner.table
WITH DISTRIBUTION ON ALL COLUMNS
AND INDEXES ALL
ALLOW WRITE ACCESS’);
…but got this error instead:
Function call <sql ( datastore, RUNSTATS ON dbowner.table
WITH DISTRIBUTION ON ALL COLUMNS
AND INDEXES ALL
ALLOW WRITE ACCESS )
failed, due to error <70401>: <ODBC data source error message for operation
: <[IBM][CLI Driver] CLI0125E Function sequence error. SQLSTATE=S1010>.>.
|Session JOBNAME INFO: The above error occurs in the context <|Session JOBNAME|sql(…) Function Body|>.
|Session JOBNAME ODBC data source error message for operation : <[IBM][CLI Driver] CLI0125E Function sequence error. SQLSTATE=S1010>.
Unfortunately, I don’t have the option to reinstall db2 or remove any groups. The command is run against a small table (42 rows, 9 columns). Anyway, this command works when used on DB2 admin tools client. It seems to be a problem when running inside DI. I’m wondering if I’m using the proper DI syntax to call a RUNSTATS statement…it’s not different from all other DB2 SQL commands, is it? I’ve been able to call DROP/CREATE/ALTER statements within DI successfully so far. Hmm…