1. 统计所有节点表空间使用率
select substr(TABLESPACE_NAME,1,20) as TBSPC_NAME,bigint(TOTAL_PAGES * PAGE_SIZE)/1024/1024 as "TOTAL(MB)",
used_pages*PAGE_SIZE/1024/1024 as "USED(MB)", free_pages*PAGE_SIZE/1024/1024 as "FREE(MB)"
from table(snapshot_tbs_cfg('DB_NAME', -2)) as snapshot_tbs_cfg
2、查看表空间使用率
select substr(tbsp_name,1,20) as TABLESPACE_NAME,substr(tbsp_content_type,1,10) as TABLESPACE_TYPE,sum(tbsp_total_size_kb)/1024 as TOTAL_MB,
sum(tbsp_used_size_kb)/1024 as USED_MB,sum(tbsp_free_size_kb)/1024 as FREE_MB,tbsp_page_size AS PAGE_SIZE
from SYSIBMADM.TBSP_UTILIZATION group by tbsp_name,tbsp_content_type,tbsp_page_size
order by 1
3、通过存储过程查看数据库大小和容量
db2 call GET_DBSIZE_INFO (?,?,?,0)
输出参数的值
--------------------------
参数名: SNAPSHOTTIMESTAMP
参数值: 2008-05-26-10.53.06.421000
参数名: DATABASESIZE
参数值: 1203863552
参数名: DATABASECAPACITY
参数值: 4281493504