db2 select "substr(tbsp_name,1,35) as tbsp_name, tbsp_id, decimal(float(TBSP_PAGE_SIZE*TBSP_USED_PAGES)/1048576,10,2) as used_gb, decimal(float(TBSP_PAGE_SIZE*TBSP_TOTAL_PAGES)/1048576,10,2) as total_gb from table(mon_get_tablespace(NULL,1)) order by 4 desc"
db2 -x select "substr(tbsp_name,1,35) as tbsp_name, tbsp_id, decimal(float(TBSP_PAGE_SIZE*TBSP_USED_PAGES)/1048576,10,2) as used_gb, decimal(float(TBSP_PAGE_SIZE*TBSP_TOTAL_PAGES)/1048576,10,2) as total_gb from table(mon_get_tablespace(NULL,1)) order by 4 desc" | awk 'BEGIN{sum=0}{sum+=$4}END{print sum}'