↪ replying to Meza, Silvana
Use this
scripts,
#!/bin/ksh
# IFMX VERSION: Online 7.x and 9.x
# DESCRIPTION : Reports numbers for free and total kb and % of space free
# for each dbspace in the engine.
#
# AUTHOR : Mike Lowe
#
CHKUP=`onstat - | egrep "On-Line"`
if [ -z "$CHKUP" ]
then
echo "\\
This instance is down!\\
"
exit 0
fi
PGSIZ=`onstat -b | tail -2 | line | awk '{ print $10 }'`
PGSIZ=`expr $PGSIZ / 1000`
onstat -d | awk '
BEGIN { printf("\\
--------- (pgs) ---------
--------- (kbs) ---------\\
")printf(" DBSPACE %%FREE USED FREE TOTAL USED
FREE TOTAL\\
") }
/ informix / { name[$2] = $NF
if ( $2 > numdb )
numdb = $2 }
/ P[ODI]- / { tot[$3]+=$5
fre[$3]+=$6
gtot+=$5
ftot+=$6 }
/ P[ODI]B / { tot[$3]+=$5
bfre=substr($6,2,6)
fre[$3]+=bfre
gtot+=$5
ftot+=bfre }
END { for (i=1; i<=numdb; i++)
{
if ( name[i] != "" )
{
printf("[ d] %-10s -%% ", i, name[i], fre[i]/tot[i]*100 )
printf(" ", tot[i]-fre[i], fre[i], tot[i])
printf(" \\
", (tot[i]-fre[i])*pgsiz, fre[i]*pgsiz,
tot[i]*pgsiz)
}
}
printf("\\
%-10s %3s ", "TOTAL:", "" )
printf(" ", gtot-ftot, ftot, gtot)
printf(" \\
\\
", (gtot-ftot)*pgsiz, ftot*pgsiz, gtot*pgsiz)
} ' pgsiz=$PGSIZ
#--------------------END SCRIPT -------------------------------------------
Say thanks to Mike Lowe :)
Walter
-----Original Message-----
From: Meza, Silvana [mailto:smeza@fheg.follett.com]
Sent: Monday, February 10, 2003 3:27 PM
To: ids@iiug.org
Subject: database current size used. [319]
IDS 7.31uc7
AIX 4.3.3
I know that onstat -d gives the current size allocated and free in
pages....but
it doesn't give any totals.
Is there an easy way to get the total size that is actually being used?
Silvana