Find out how much Space is Being Used by Tables

Tbstat -d gives you an output that shows the raw information necessary to calculate the free space in your database, but it is not organized in a way that is easy to comprehend.

This script, a C-Shell script called dbdf, does a much cleaner job:

 #!/bin/csh #dbdf $INFORMIXDIR/bin/tbstat -d | grep / | grep -v bpages | sort +2 -3 -n |awk '{printf ("%s\t*s\t%s\t%s\n", $3, $5, $6, $8) }' > /tmp/c$$ $INFORMIXDIR/bin/tbstat -d | grep informix | awk '{print $2, $8}' > /trap/s$$ join /tmp/s$$ /tmp/c$$ > /tmp/j$$ awk '\ BEGIN {name=""} \ {total[$2]+=$3; free[$2]+=$4} \ END { for (space in total) printf("%-12s is %.2f percent full and has %6d free pages \n", space, (1-free [space]/total[space])*100,free[space])} ...

Get Informix DBA Survival Guide, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.