In Article<3sn8fn$9k0@cssun.mathcs.emory.edu>
> From: GESJOBER@ADM1.byu.edu (Glen Sjoberg)
> Newsgroups: comp.databases.informix
> Subject: dbspace space report
> Date: 26 Jun 1995 17:23:03 -0400
>
> ...
>
> I was just about to write a script that would do a tbstat -d for each
> instance and generate a report from the output showing how much free
> space was left.
>
> ...
>
> Is there a utility (besides tbstat -d) that will give me this
> information or has someone already written such a report?
>
The following script was origionally published in Joe Lumbley's DBA
Survival Guide. I modified it slightly to accomodate our needs. I'm
sure it could be expanded to suit your needs as well. Hope this helps...
----------8<------ Snip --------8<---------------
#!/bin/ksh
#dbdf
$INFORMIXDIR/bin/onstat -d > /tmp/a$$
cat /tmp/a$$ | grep / | \\
grep -v bpages | \\
sort +2 -3 -n | \\
awk '{printf("%.2d\\t%s\\t%s\\t%s\\n", $3,$5,$6,$8)}' >
/tmp/c$$
cat /tmp/a$$ | grep informix | \\
grep -v / | \\
awk '{printf("%.2d\\t%s\\n", $2,$8)}' > /tmp/s$$
join /tmp/s$$ /tmp/c$$ > /tmp/j$$
print
print "DBSpace Name Total Pages Free Pages % Full"
print "========================================================="
awk 'BEGIN { name = "" } { total[$2] += $3; free[$2] += $4} \\
END { for (space in total) \\
printf("%-20s %8d %8d %6.2f \\n", \\
space, total[space], free[space],
(1-free[space]/total[space])*100) }' \\
/tmp/j$$ | grep -v log | grep -v informix | sort +3 -r
print "========================================================="
print
rm /tmp/[acsj]$$