db2

A Shell script to get total space allocated in a database

Often I get asked how much space does the database take and I end up doing list tablespace and calculating total pages * page size .  I tried using the  GET_DBSIZE_INFO stored procedure , it doesn’t seem to give the right size.  So I wrote a small shell script that does thru all the databases in an instance and calculate the dbsize of each of them. You may have to modify the directory names to suit your need.  Let me know if you think of any improvements I can make.

getdbspace.sh