1.SQL 查询(选择Schema为SYSPROC) SELECT SUBSTR(TABLESPACE_NAME,,) AS TBSPC_NAME, AS "TOTAL(MB)", used_pages AS "USED(MB)", free_pages AS "FREE(MB)" FROM )) AS snapshot_tbs_cfg 2.存储过程查询(选择Schema为SYSPROC) db2 call GET_DBSIZE_INFO (?,
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)" f
Db2 connect to xxx Db2 “LIST TABLESPACES SHOW DETAIL” Tablespace ID = 7 Name = TSASNAA Type = Database managed space Contents = All permanent data. Large table space. State = 0x0000 Detailed explanation:[@more@] Normal Total pages = 14800 Useable pag
select substr(tbsp_name,1,20) as 表空间名称,substr(tbsp_content_type,1,10) as 表空间类型,sum(tbsp_total_size_kb)/1024/1024 as 表空间总大小(G),sum(tbsp_used_size_kb)/1024/1024 as 已经使用的表空间大小(G),sum(tbsp_free_size_kb)/1024/1024 as 剩余表空间大小(G),tbsp_page_size AS 页大小from S
1. 全部表空间的大小select tablespace_name, sum(bytes)/1024/1024 from dba_data_files group by tablespace_name;TABLESPACE_NAME SUM(BYTES)/1024/1024-------------------- --------------------UNDOTBS1 65SYSAUX 520USERS
使用的命令: db2 list tablespaces show detail db2 list tablespace containers for [Tablespace ID] [show detail] 说明:在语句末尾添加show detail,则能查看表空间大小以及使用的信息 以下是具体实现案例: 在日常使用db2的过程中,有时候我们需要查询db2表空间所存储的位置来判断磁盘空间是否还够用,下面为查询表空间TEMPTS16K的位置 db2inst1@Linux:/opt> db2 li
--1.查看表空间的名称及大小 )), ) ts_size FROM dba_tablespaces t, dba_data_files d WHERE t.tablespace_name = d.tablespace_name GROUP BY t.tablespace_name; --2.查看表空间物理文件的名称及大小 SELECT tablespace_name, file_id, file_name, ), ) total_space FROM dba_data_files ORDER