SqlDbx Forum

SqlDbx

You are not logged in.

#1 2010-10-08 07:29:42

Puzzled
Guest

DB2 LUW 9.7.2 RUNSTATS Command

Can someone please give me an example of how to run a RUNSTATS command via SQLDBX ?

For the life of me I cannot get the command to work as it fails with the following error:

SQL0104N  An unexpected token "TABLE" was found following "RUNSTATS ON ".  Expected tokens may include:  "JOIN".  SQLSTATE=42601

however when the same command is entered by the CLP it works just fine.

Command:

RUNSTATS ON TABLE DB2ADMIN.TEST_TABLE ON KEY COLUMNS WITH DISTRIBUTION AND SAMPLED DETAILED INDEXES ALL ALLOW WRITE ACCESS

#2 2010-10-08 07:32:47

Puzzled
Guest

Re: DB2 LUW 9.7.2 RUNSTATS Command

Connection is via CLI .. sorry, missed that.

#3 2010-10-08 08:36:26

sqldbxhelp
Administrator

Re: DB2 LUW 9.7.2 RUNSTATS Command

RUNSTATS is a CLP command and is not SQL statement.
To run this command in SqlDbx you need to use ADMIN_CMD procedure.
You can find details on how to use ADMIN_CMD in "Administrative Routines and Views" manual for DB2 for LUW

Offline

#4 2010-10-08 16:10:00

Puzzled
Guest

Re: DB2 LUW 9.7.2 RUNSTATS Command

Many thanks for that, problem solved.

#5 2016-05-20 07:19:54

alfredalfred
Member

Re: DB2 LUW 9.7.2 RUNSTATS Command

Can someone please give me an example of how to run a RUNSTATS command via SQLDBX ?????





==== www.solitairechamp.net ====

Last edited by alfredalfred (2016-05-26 08:44:15)

Offline

#6 2016-05-22 09:06:40

sqldbxhelp
Administrator

Re: DB2 LUW 9.7.2 RUNSTATS Command

CALL SYSPROC.ADMIN_CMD ('RUNSTATS ON TABLE EMPLOYEE ON KEY COLUMNS and INDEXES ALL ')

Offline

Board footer

Powered by FluxBB