vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hello, DB2 LUW v8 FP15 I am running a simple 'runstats on table session.temp_MID_1 and indexes all' and it fails with [04/29/2008 13:25:49.902600] SQLAllocStmt( phStmt=4:2 ) [04/29/2008 13:25:49.902707] <--- SQL_SUCCESS Time elapsed - +6.190000E-004 seconds [04/29/2008 13:25:49.903030] SQLExecDirectW( hStmt=4:2, pszSqlStr="RUNSTATS ON TABLE SESSION.TEMP_MID_1 AND INDEXES ALL", cbSqlStr=52 ) [04/29/2008 13:25:49.903327] ---> Time elapsed - +3.230000E-004 seconds [04/29/2008 13:25:49.903457] ( StmtOut="RUNSTATS ON TABLE SESSION.TEMP_MID_1 AND INDEXES ALL" ) [04/29/2008 13:25:49.903583] [04/29/2008 13:25:49.903664] ( Package="SYSSH100 ", Section=65 ) [04/29/2008 13:25:49.903813] sqlccsend( Handle - 2010514272 ) sqlccsend( ulBytes - 169 ) sqlccsend( ) rc - 0, time elasped - +4.500000E-005 sqlccrecv( ) sqlccrecv( ulBytes - 213 ) - rc - 0, time elapsed - +1.919000E-003 [04/29/2008 13:25:49.906177] ( COMMIT REPLY RECEIVED=1 ) [04/29/2008 13:25:49.906634] [04/29/2008 13:25:49.906748] SQLExecDirectW( ) [04/29/2008 13:25:49.906826] <--- SQL_ERROR Time elapsed - +3.796000E-003 seconds [04/29/2008 13:25:49.901761] SQLFreeStmt( ) [04/29/2008 13:25:49.901826] <--- SQL_SUCCESS Time elapsed - +5.340000E-004 seconds [04/29/2008 13:25:49.902088] SQLAllocStmt( hDbc=0:4, phStmt=&a45fedc4 ) [04/29/2008 13:25:49.902325] ---> Time elapsed - +2.620000E-004 seconds [04/29/2008 13:25:49.902417] ( Re-using Cached Statement Structure=1 ) [04/29/2008 13:25:49.902529] [04/29/2008 13:25:49.902600] SQLAllocStmt( phStmt=4:2 ) [04/29/2008 13:25:49.902707] <--- SQL_SUCCESS Time elapsed - +6.190000E-004 seconds [04/29/2008 13:25:49.903030] SQLExecDirectW( hStmt=4:2, pszSqlStr="RUNSTATS ON TABLE SESSION.TEMP_MID_1 AND INDEXES ALL", cbSqlStr=52 ) [04/29/2008 13:25:49.903327] ---> Time elapsed - +3.230000E-004 seconds [04/29/2008 13:25:49.903457] ( StmtOut="RUNSTATS ON TABLE SESSION.TEMP_MID_1 AND INDEXES ALL" ) [04/29/2008 13:25:49.903583] [04/29/2008 13:25:49.903664] ( Package="SYSSH100 ", Section=65 ) [04/29/2008 13:25:49.903813] sqlccsend( Handle - 2010514272 ) sqlccsend( ulBytes - 169 ) sqlccsend( ) rc - 0, time elasped - +4.500000E-005 sqlccrecv( ) sqlccrecv( ulBytes - 213 ) - rc - 0, time elapsed - +1.919000E-003 [04/29/2008 13:25:49.906177] ( COMMIT REPLY RECEIVED=1 ) [04/29/2008 13:25:49.906634] [04/29/2008 13:25:49.906748] SQLExecDirectW( ) [04/29/2008 13:25:49.906826] <--- SQL_ERROR Time elapsed - +3.796000E-003 seconds [04/29/2008 13:25:49.906970] SQLGetSqlca( hEnv=0:0, hDbc=0:0, hStmt=4:2, pSqlcaOut=&081c92a8 ) [04/29/2008 13:25:49.907233] ---> Time elapsed - +1.440000E-004 seconds [04/29/2008 13:25:49.907321] SQLGetSqlca( ) [04/29/2008 13:25:49.907393] <--- SQL_SUCCESS Time elapsed - +4.230000E-004 seconds [04/29/2008 13:25:49.907486] SQLGetDiagFieldW( fHandleType=SQL_HANDLE_STMT, hHandle=4:2, iRecNumber=1, fDiagIdentifier=Unknown value 2467, pDiagInfo=&a45fe47c, cbDiagInfoMax=140, pcbDiagInfo=&a45fe478 ) [04/29/2008 13:25:49.907843] ---> Time elapsed - +9.300000E-005 seconds [04/29/2008 13:25:49.907956] SQLGetDiagFieldW( pDiagInfo=5570642, pcbDiagInfo=140 ) [04/29/2008 13:25:49.908114] <--- SQL_SUCCESS_WITH_INFO Time elapsed - +6.280000E-004 seconds [04/29/2008 13:25:49.908218] SQLGetDiagFieldW( fHandleType=SQL_HANDLE_STMT, hHandle=4:2, iRecNumber=1, fDiagIdentifier=Unknown value 2461, pDiagInfo=&a45fe474, cbDiagInfoMax=4, pcbDiagInfo=&a45fe478 ) [04/29/2008 13:25:49.908577] ---> Time elapsed - +1.040000E-004 seconds [04/29/2008 13:25:49.908658] SQLGetDiagFieldW( pDiagInfo=0, pcbDiagInfo=0 ) [04/29/2008 13:25:49.908807] <--- SQL_SUCCESS Time elapsed - +5.890000E-004 seconds [04/29/2008 13:25:49.908908] SQLErrorW( hEnv=0:0, hDbc=0:0, hStmt=4:2, pszSqlState=&a45fed14, pfNativeError=&a45fed10, pszErrorMsg=&a45fe50c, cbErrorMsgMax=1024, pcbErrorMsg=&a45fe508 ) [04/29/2008 13:25:49.909343] ---> Time elapsed - +1.010000E-004 seconds [04/29/2008 13:25:49.909565] ( iRowNumber=-1, iColumnNumber=-2 ) [04/29/2008 13:25:49.909761] [04/29/2008 13:25:49.909835] SQLErrorW( pszSqlState="42601", pfNativeError=-104, pszErrorMsg="[IBM][CLI Driver][DB2/LINUX] SQL0104N An unexpected token "RUNSTATS ON TABLE SESSION.TEM" was found following "BEGIN-OF-STATEMENT". Expected tokens may include: "<collect_stats_start>". SQLSTATE=42601 ", pcbErrorMsg=205 ) [04/29/2008 13:25:49.910104] <--- SQL_SUCCESS Time elapsed - +1.196000E-003 seconds ? It couldnīt be more simple than 'runstats on table T and indexes all'. How do I find where is the syntax error ? |
| ||||
| Michel Esber wrote: > Hello, > > DB2 LUW v8 FP15 > > > I am running a simple 'runstats on table session.temp_MID_1 and > indexes all' and it fails with > [snip] > [04/29/2008 13:25:49.909835] SQLErrorW( pszSqlState="42601", > pfNativeError=-104, pszErrorMsg="[IBM][CLI Driver][DB2/LINUX] > SQL0104N An unexpected token "RUNSTATS ON TABLE SESSION.TEM" was > found following "BEGIN-OF-STATEMENT". Expected tokens may include: > "<collect_stats_start>". SQLSTATE=42601 > ", pcbErrorMsg=205 ) > [04/29/2008 13:25:49.910104] <--- SQL_SUCCESS Time elapsed - > +1.196000E-003 seconds > > > > ? It couldnīt be more simple than 'runstats on table T and indexes > all'. How do I find where is the syntax error ? The problem is that RUNSTATS is a CLP command, not an SQL statement. Therefore you can't (directly) execute it via an interface like ODBC (or JDBC, etc), just as you can't use IMPORT, LOAD, EXPORT, etc. directly via ODBC. However, the ADMIN_CMD stored procedure in v8 does support RUNSTATS, so you should be able to execute it via something like: CALL ADMIN_CMD('RUNSTATS ON TABLE SESSION.TEMP_MID_1 AND INDEXES ALL') See http://publib.boulder.ibm.com/infoce...om.ibm.db2.udb ..doc/admin/r0012547.htm for details of ADMIN_CMD under v8. Cheers, Dave. |