如何查询含有blob字段的表所占用的空间的相关推荐
1个回答
展开全部
写了一个,你试试:
select a.TABLESPACE_NAME "TableSpace Name",
round(a.BYTES / 1024 / 1024) "MB Allocated",
round((a.BYTES-nvl(b.BYTES, 0)) / 1024 / 1024) "MB Used",
nvl(round(b.BYTES / 1024 / 1024), 0) "MB Free",
round(((a.BYTES-nvl(b.BYTES, 0))/a.BYTES)*100,2) "Pct Used"
from (select TABLESPACE_NAME,
sum(BYTES) BYTES
from sys.dba_data_files
group by TABLESPACE_NAME) a,
(select TABLESPACE_NAME,
sum(BYTES) BYTES
from sys.dba_free_space
group by TABLESPACE_NAME) b
where a.TABLESPACE_NAME = b.TABLESPACE_NAME (+)
And a.tablespace_name in ('表空间名','表空间名','表空间名');
select a.TABLESPACE_NAME "TableSpace Name",
round(a.BYTES / 1024 / 1024) "MB Allocated",
round((a.BYTES-nvl(b.BYTES, 0)) / 1024 / 1024) "MB Used",
nvl(round(b.BYTES / 1024 / 1024), 0) "MB Free",
round(((a.BYTES-nvl(b.BYTES, 0))/a.BYTES)*100,2) "Pct Used"
from (select TABLESPACE_NAME,
sum(BYTES) BYTES
from sys.dba_data_files
group by TABLESPACE_NAME) a,
(select TABLESPACE_NAME,
sum(BYTES) BYTES
from sys.dba_free_space
group by TABLESPACE_NAME) b
where a.TABLESPACE_NAME = b.TABLESPACE_NAME (+)
And a.tablespace_name in ('表空间名','表空间名','表空间名');
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询