Database size in DB2 – Find 3 methods I use to find the database size in DB2
METHOD 1 – GET_DBSIZE_INFO
============================
db2 connect to <db>
db2 “CALL GET_DBSIZE_INFO (?, ?, ?, -1)”
METHOD 2a (in MB) snapshot_tbs_cfg
===============================
db2 connect to <database-name>
db2 “select (sum(total_pages)* 4096)/(1024*1024) Tot_allocat_spceinMB from table(snapshot_tbs_cfg(‘ ‘,-1)) TBS_SPCE”
METHOD 2b (in GB)snapshot_tbs_cfg
==================================
db2 “select (SUM(total_pages)*4)/(1024.0*1024) TOTAL_ALLOCATED_SPACE_IN_GB from table (snapshot_tbs_cfg(‘<DBNAME>’,-1)) TBS_SPCE”
db2 connect reset
METHOD 3 systools.stmg_dbsize_info
================================
SELECT db_size, db_capacity FROM systools.stmg_dbsize_info;
Author: Jack Vamvas
Leave a Reply