Re: What's that darned script, anyway!
Posted in 1995
> Hi all,
>
> A while back I saw an "update statistics" script
> that would update all statistics on all dbs.
>
> The script, I believe, was in the excellent book
> "Informix DBA Survial Guide" by our friend, Mr. Lumbley,
> but was also graciously shared on the group.
>
> If someone would take the time to simply cut and paste
> to an email and forward it to me I would be
> very greatful! :-)!
>
>
> Thanks in advance!
>
> Matt Silveira
> System Engineer
> OSI
>
It's not Mr. Lumbley's version (I don't have his book) but this one works
for me on several different platforms including SCO Open Desktop 3.0.0
and Informix 5.0...
################################################################################
# PROGRAM: upstat.sh #
# Version: 01.00.00.00 #
# Date: 02-JUL-1994 #
# #
# This script file will perform an "update statistics" on every database #
# found in the current instance of OnLine. #
# #
# 07/02/94 upstat.sh was created. Walter S. Tyszka #
################################################################################
CONS="/dev/console"
INFORMIXDIR=`/bin/grep ^informix: /etc/passwd | /usr/bin/cut -f6 -d":"`LOGFIL="${INFORMIXDIR}/upstat.log"
cp /dev/null $LOGFIL
for DB in `${INFORMIXDIR}/bin/tbcheck -pe | /bin/grep systables | /usr/bin/cut -f1 -d":" | /bin/sort -u`
do
UPSMSG="Update statistics for ($DB) database started at `date '+%T %D'`"
echo $UPSMSG | /bin/tee -a $LOGFIL >$CONS 2>&1
${INFORMIXDIR}/bin/isql 2>/dev/null "$DB" <<+
update statistics;+
UPCMSG="Update statistics for ($DB) database completed at `date '+%T %D'`"
echo $UPCMSG | /bin/tee -a $LOGFIL >$CONS 2>&1
done
exit $?
################################################################################
--
--------------------------------------------------------------------------
Walter S. Tyszka | It's all just | wstyszka@ingr.com
I/CATS Support Administrator | a matter of | 205-730-5723
Intergraph Corporation | perception. | Huntsville, Alabama
--------------------------------------------------------------------------