Abstract

There is no command provided with IBM Informix Dynamic Server that shows the total size of each database in an instance. If you want to know which are using the most space, but do not have a GUI or need an automated script, this article provides an SQL statement for that purpose.

Content

The following SQL run on the “sysmaster” database returns the totals of allocated and used pages per database:

Copy to Clipboard

Sample output is provided below:

dbsnamekb_allockb_used
demo297784268662
test9722210
example501790395588
stores42323014
sysadmin6345060840
sysmaster39302538
sysuser29122054
sysutils41842438

For example, the total of all extents (contiguous blocks of disk pages) allocated to tables and indexes in the standard “stores” demo database is 4232 KB, but only 3014 KB of pages within these extents have been consumed so far.

Conclusion

SQL queries on the “sysmaster” database are very useful and sometimes simpler than you might think!

Disclaimer

The code fix suggested above is provided “as is” without warranty of any kind, either express or implied, including without limitation any implied warranties of condition, uninterrupted use, merchantability, fitness for a particular purpose, or non-infringement.