BETA Test of New Features in dostats
Posted in 2009
Art Kagel announced a beta of dostats with new features (writing UPDATE STATISTICS into a stored procedure and optionally scheduling it via the IDS 11.x Task Scheduler/sysadmin tables) and asked for testers; one volunteer stepped up. A side question asked whether a Windows binary exists; Art said only source is shipped and the makefiles are UNIX/GNU-make specific. Christian Knappke later reported building dostats on Windows with CSDK 3.50 and MinGW gcc, posting his own GNU Makefile plus a diff to dostats.ec (renaming shutdown() to avoid a winsock2 clash, mapping SIGQUIT to SIGBREAK, guarding max/MAXWORD, and switching connection names to single quotes).
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Stored Procedures & SPL
I have added an exciting new feature set to dostats - the ability to write the UPDATE STATISTICS commands to a stored procedure in the target data base and optionally add an execution schedule to the IDS Task Scheduler tables in sysadmin! Since this is a major new feature and is writing to these new tables in sysadmin, I'd like a reasonable number of volunteers using IDS 11.xx who would like to beta test the feature. Any takers? Art S. Kagel Oninit (www.oninit.com) IIUG Board of Directors (art@iiug.org) Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Oninit, the IIUG, nor any other organization with which I am associated either explicitly or implicitly. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. --001636c5a435ea6cf2046d22608e
Hey Art ... I'd be willing to give it a workout ... Peter Logan Senior Database Administrator Phone: 616/878-8309 From: "Art Kagel" <art.kagel@gmail.com> To: ids@iiug.org Date: 06/24/2009 09:46 PM Subject: BETA Test of New Features in dostats [16155] Sent by: ids-bounces@iiug.org I have added an exciting new feature set to dostats - the ability to write the UPDATE STATISTICS commands to a stored procedure in the target data base and optionally add an execution schedule to the IDS Task Scheduler tables in sysadmin! Since this is a major new feature and is writing to these new tables in sysadmin, I'd like a reasonable number of volunteers using IDS 11.xx who would like to beta test the feature. Any takers? Art S. Kagel Oninit (www.oninit.com) IIUG Board of Directors (art@iiug.org) Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Oninit, the IIUG, nor any other organization with which I am associated either explicitly or implicitly. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. --001636c5a435ea6cf2046d22608e ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum.
Is there a Windows binary for dostats? J,. 2009/6/24 Art Kagel <art.kagel@gmail.com> > I have added an exciting new feature set to dostats - the ability to write > the UPDATE STATISTICS commands to a stored procedure in the target data > base > and optionally add an execution schedule to the IDS Task Scheduler tables > in > sysadmin! > > Since this is a major new feature and is writing to these new tables in > sysadmin, I'd like a reasonable number of volunteers using IDS 11.xx who > would like to beta test the feature. Any takers? > > Art S. Kagel > Oninit (www.oninit.com) > IIUG Board of Directors (art@iiug.org) > > Disclaimer: Please keep in mind that my own opinions are my own opinions > and > do not reflect on my employer, Oninit, the IIUG, nor any other organization > with which I am associated either explicitly or implicitly. Neither do > those opinions reflect those of other individuals affiliated with any > entity > with which I am affiliated nor those of the entities themselves. > > --001636c5a435ea6cf2046d22608e > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --00163630f0ef4842c0046d4000f4
There's only source Jean. There's no reason why it wouldn't compile on wi= ndows, but the makefiles are UNIX make specific with a couple of lines of = GNU make conditionals, so you'd have to create you own makefiles or compil= e it by hand. art -----Original Message----- From: Jean Sagi <jeansagi.ifx@gmail.com> Sent: Friday, June 26, 2009 9:06 AM To: ids@iiug.org Subject: Re: BETA Test of New Features in dostats [16167] Is there a Windows binary for dostats?=20 J,.=20 2009/6/24 Art Kagel <art.kagel@gmail.com>=20 > I have added an exciting new feature set to dostats - the ability to writ= e=20 > the UPDATE STATISTICS commands to a stored procedure in the target data=20 > base=20 > and optionally add an execution schedule to the IDS Task Scheduler tables= =20 > in=20 > sysadmin!=20 >=20 > Since this is a major new feature and is writing to these new tables in=20 > sysadmin, I'd like a reasonable number of volunteers using IDS 11.xx who= =20 > would like to beta test the feature. Any takers?=20 >=20 > Art S. Kagel=20 > Oninit (www.oninit.com)=20 > IIUG Board of Directors (art@iiug.org)=20 >=20 > Disclaimer: Please keep in mind that my own opinions are my own opinions= =20 > and=20 > do not reflect on my employer, Oninit, the IIUG, nor any other organizati= on=20 > with which I am associated either explicitly or implicitly. Neither do=20 > those opinions reflect those of other individuals affiliated with any=20 > entity=20 > with which I am affiliated nor those of the entities themselves.=20 >=20 > --001636c5a435ea6cf2046d22608e=20 >=20 >=20 >=20 >=20 ***************************************************************************= ****=20 > Forum Note: Use "Reply" to post a response in the discussion forum.=20 >=20 >=20 --00163630f0ef4842c0046d4000f4=20 ***************************************************************************= ****=20 Forum Note: Use "Reply" to post a response in the discussion forum.=20
Hi Jean,
yesterday I managed to compile dostats on Windows. I used CSDK 3.50 and gcc
from the MinGW package. But you can also use MS VC++ Express 2005 or 2008. I
didn't try these. BTW, esqlc wants to use MSC or Borland C by default if you
don't tell it otherwise.
I used my own Makefile:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# This version is GNU Make specific
#
.SUFFIXES:
.SUFFIXES: .ec .c .o
ESQL=esql
CFLG=-O
CFLAGS=$(CFLG) -DHAVE_GETOPT_H=1 -D_WINDOWS_
GETOPT=getopt.c
GETOPTFLG=-I.
EDFLAGS=-g -thread -rt:s
INCLUDES=-I$(INFORMIXDIR)/incl/esql $(GETOPTFLG)
LIBS=$(INFORMIXDIR)/lib/isqlt09a.lib \\\\
$(INFORMIXDIR)/lib/igl4n304.lib \\\\
$(INFORMIXDIR)/lib/iglxn304.lib \\\\
$(INFORMIXDIR)/lib/igo4n304.lib \\\\
-lnetapi32 \\\\
-lwsock32 \\\\
-luser32 \\\\
-lwinmm \\\\
-ladvapi32
ECFLAGS=$(EDFLAGS)
CC=gcc
INFORMIXC=$(CC)
progs: dostats.exe
dostats.exe: dostats.o getopt.o
$(CC) $(INCLUDES) $(CFLAGS) -o $@ $? $(LIBS)
dostats.o: dostats.c
$(CC) $(INCLUDES) $(CFLAGS) -o $@ -c $?
getopt.o: $(GETOPT)
$(CC) $(INCLUDES) $(CFLAGS) -o $@ -c $?
dostats.c: dostats.ec
$(ESQL) -e $(ECFLAGS) $?
clean:
rm -f dostats.c dostats.c_ dostats.o getopt.o dostats.exe *~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Set %INFORMIXDIR% to the installation folder of the CSDK and put all
executables (CSDK and MinGW) into the PATH. The list of necessary libraries is
provided by esqlc if you ask nicely with the -libs switch.
After that compiling dostats is as easy as to type "make" on the commandline.
HTH and best regards
Christian
Sorry, but I forgot to mention that there need to be some changes to dostats.ec before it compiles. See diff: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/dostats.ec b/dostats.ec index 933ca96..dd86114 100755 --- a/dostats.ec +++ b/dostats.ec @@ -362,6 +362,10 @@ #include <strings.h> #endif #include <signal.h> +#if defined(_WINDOWS_) +#include <windows.h> +#define SIGQUIT SIGBREAK +#endif /* * Define HAVE_GETOPT_H if you are using GNU's or my version of getopt on a * platform that does not have it already or if your platform does not define @@ -477,7 +481,7 @@ void timediff( struct timeval, struct timeval, int *, int * ); #endif void usage( char *program ); void exit( int stat ); -void shutdown( int sig ); +void dostats_shutdown( int sig ); /* Renamed from shutdown() because of conflicts with winsock2.h */ #define STR_STEP 1024 void readlist( char **, int *, char **, int *, char * ); void appendStr( char **, int *, char * ); @@ -502,10 +506,12 @@ int is_Server_Optimized( int major, int minor, char *level ); *target = 0; \\\\ } #else +#ifndef max inline int max( int a, int b) { return (a > b ? a : b); } +#endif inline void strlower( char *target, char *source, int max ) { while (max-- && *source) { @@ -516,14 +522,14 @@ inline void strlower( char *target, char *source, int max ) #endif -void shutdown( int sig ) +void dostats_shutdown( int sig ) { sqlbreak(); if (conn == 1 && Release != 5) { - EXEC SQL SET CONNECTION "WORK"; + EXEC SQL SET CONNECTION 'WORK'; sqlbreak(); } else if (Release != 5) { - EXEC SQL SET CONNECTION "DBASES"; + EXEC SQL SET CONNECTION 'DBASES'; sqlbreak(); } EXEC SQL DISCONNECT ALL; @@ -575,8 +581,8 @@ int main(int argc, char *argv[]) }; int longint; - signal( SIGINT, shutdown ); - signal( SIGQUIT, shutdown ); + signal( SIGINT, dostats_shutdown ); + signal( SIGQUIT, dostats_shutdown ); if (getenv( "DELIMIDENT" ) != (char *)NULL) { QuotedIdents = 1; @@ -1467,7 +1473,7 @@ int main(int argc, char *argv[]) if (have_smi && (!singledb || doBrowse || doDistAging)) { if (username[0] != (char)0) { if (passwd[0] != (char)0) - EXEC SQL CONNECT TO :connhost AS "DBASES" + EXEC SQL CONNECT TO :connhost AS 'DBASES' USER :username USING :passwd WITH CONCURRENT TRANSACTION; else { @@ -1477,7 +1483,7 @@ int main(int argc, char *argv[]) exit( 1 ); } } else - EXEC SQL CONNECT TO :connhost AS "DBASES" + EXEC SQL CONNECT TO :connhost AS 'DBASES' WITH CONCURRENT TRANSACTION; if (sqlca.sqlcode) { fprintf( stderr, @@ -1603,7 +1609,7 @@ int main(int argc, char *argv[]) } else numparts = 0; if (singledb) { - EXEC SQL DISCONNECT "DBASES"; + EXEC SQL DISCONNECT 'DBASES'; if (sqlca.sqlcode) { fprintf( stderr, "FAILED: Cannot safely disconnect from sysmaster! " @@ -1623,7 +1629,7 @@ int main(int argc, char *argv[]) if (username[0] != (char)0) { if (passwd[0] != (char)0) - EXEC SQL CONNECT TO :connhost AS "WORK" + EXEC SQL CONNECT TO :connhost AS 'WORK' USER :username USING :passwd WITH CONCURRENT TRANSACTION; else { @@ -1633,7 +1639,7 @@ int main(int argc, char *argv[]) exit( 1 ); } } else - EXEC SQL CONNECT TO :connhost AS "WORK" + EXEC SQL CONNECT TO :connhost AS 'WORK' WITH CONCURRENT TRANSACTION; if (sqlca.sqlcode) { fprintf( stderr, @@ -1792,7 +1798,7 @@ int main(int argc, char *argv[]) /* Connection to sysadmin for scheduling if needed. */ if (username[0] != (char)0) { if (passwd[0] != (char)0) - EXEC SQL CONNECT TO :connhost AS "SCHEDULER" + EXEC SQL CONNECT TO :connhost AS 'SCHEDULER' USER :username USING :passwd WITH CONCURRENT TRANSACTION; else { @@ -1802,7 +1808,7 @@ int main(int argc, char *argv[]) exit( 1 ); } } else - EXEC SQL CONNECT TO :connhost AS "SCHEDULER" + EXEC SQL CONNECT TO :connhost AS 'SCHEDULER' WITH CONCURRENT TRANSACTION; if (sqlca.sqlcode) { fprintf( stderr, @@ -1837,7 +1843,7 @@ int main(int argc, char *argv[]) } if (!singledb) { - EXEC SQL SET CONNECTION "DBASES"; + EXEC SQL SET CONNECTION 'DBASES'; if (sqlca.sqlcode) { fprintf( stderr, "FAILED %d: Cannot set connection to (%s); error=%d, isam=%d\\ ", @@ -1871,7 +1877,7 @@ int main(int argc, char *argv[]) once = 1; } } else { - EXEC SQL SET CONNECTION "DBASES"; + EXEC SQL SET CONNECTION 'DBASES'; conn = 1; if (sqlca.sqlcode) { fprintf( stderr, @@ -1946,7 +1952,7 @@ int main(int argc, char *argv[]) exit( 1 ); } unlink( schedprocfilename ); - EXEC SQL SET CONNECTION "SCHEDULER"; + EXEC SQL SET CONNECTION 'SCHEDULER'; if (sqlca.sqlcode != 0) { fprintf( stderr, "Error changing connections to SCHEDULER: %s! SQL: %d ISAM: %d\\ ", @@ -2023,7 +2029,7 @@ int main(int argc, char *argv[]) if (have_smi && !singledb) { /* Switch to connection for table work. */ - EXEC SQL SET CONNECTION "WORK"; + EXEC SQL SET CONNECTION 'WORK'; conn = 2; if (sqlca.sqlcode) { fprintf( stderr, @@ -4534,7 +4540,7 @@ int main(int argc, char *argv[]) fflush( schedfile ); fclose( schedfile ); - EXEC SQL SET CONNECTION "WORK"; + EXEC SQL SET CONNECTION 'WORK'; if (sqlca.sqlcode) { fprintf( stderr, "FAILED %d: Cannot set connection to (%s); error=%d, isam=%d\\ ", @@ -4574,7 +4580,7 @@ int main(int argc, char *argv[]) exit( 1 ); } unlink( schedprocfilename ); - EXEC SQL SET CONNECTION "SCHEDULER"; + EXEC SQL SET CONNECTION 'SCHEDULER'; if (sqlca.sqlcode != 0) { fprintf( stderr, "Error changing connections to SCHEDULER: %s! SQL: %d ISAM: %d\\ ", @@ -5166,8 +5172,9 @@ void usage( char *program ) } } - +#if !defined(MAXWORD) #define MAXWORD 65536 +#endif /* Remove 'out' & 'inout' parameter type entries from parameter type lists. */ void StripTypeList( char *list ) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~