达梦数据库查看表空间使用情况

栏目:eas cloud知识作者:金蝶来源:金蝶云社区发布:2024-09-22浏览:1

达梦数据库查看表空间使用情况

1、查看整体表空间使用情况

SELECT F.TABLESPACE_NAME,

(T.TOTAL_SPACE - F.FREE_SPACE) / 1024 "USED (GB)",

F.FREE_SPACE / 1024 "FREE (GB)",

T.TOTAL_SPACE / 1024 "TOTAL(GB)",

(ROUND((F.FREE_SPACE / T.TOTAL_SPACE) * 100)) || '% ' PER_FREE

FROM (SELECT TABLESPACE_NAME,

ROUND(SUM(BLOCKS *

(SELECT PARA_VALUE / 1024

FROM V$DM_INI

WHERE PARA_NAME = 'GLOBAL_PAGE_SIZE') / 1024)) FREE_SPACE

FROM DBA_FREE_SPACE

GROUP BY TABLESPACE_NAME) F,

(SELECT TABLESPACE_NAME, ROUND(SUM(BYTES / 1048576)) TOTAL_SPACE

FROM DBA_DATA_FILES

GROUP BY TABLESPACE_NAME) T

WHERE F.TABLESPACE_NAME = T.TABLESPACE_NAME;


2、查看某一个表空间的使用情况

select file_name,bytes/1024/1024 MB,maxbytes/1024/1024 MAXM, autoextensible,tablespace_name from dba_data_files where tablespace_name='大写的表空间名字';    


达梦数据库查看表空间使用情况

1、查看整体表空间使用情况SELECT F.TABLESPACE_NAME,(T.TOTAL_SPACE - F.FREE_SPACE) / 1024 "USED (GB)",F.FREE_SPACE / 1024 ...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息