David Bishop wrote:
>
> I'm not able yet though searching manuals, to find a programmatic way to
> check for available space. In DB2 code that we're porting to Informix, we
> use sqledosd and sqledgne functions to determine drive, and then
> GetDiskFreeSpace function to check space.
>
> Are there any Informix functions that will do this ?
OK, this is not easy. Quick answer: No. However, you can use
tbcheck/oncheck -pe with some awk scripts to determine free space within
a table's already allocated extents and tbstat/onstat -d with some
awk/perl scripts to determine unallocated free space in the dbspace(s)
in which the table resides. In 7.xx there are tables in the sysmaster
database that you can use to determine these values (see syschktab and
syschfree). Both report physical disk addresses which you will have to
translate to tabid by looking at the first three hex digits in the
partnum column in systables in your own database (keeping in mind that
if a table is fragmented partnum is 0 and you will also have to look
in sysfragments).
In 5.xx there is no such facility as the sysmaster database. I have a
program that I wrote which peaks onto disk, follows the chain of bitmap
pages and determines which pages are free, but this is VERY VERY
speculative code and I would not want to share it.
Your best bet is to periodically run the scripts described above and
write the reports to disk, using the latest report for job management.
Art S. Kagel