GaussDB T分布式集群数据库每日维护必做必知

复制set line 300 set pages 2000 set timing off col tablespace_name for a25 col sum_GB for a15 col free_GB for a15 col use_precent for a15 select b.tablespace_name,分布 round(sum(b.bytes) / 1024 / 1024 / 1024, 0) sum_GB, round(sum(nvl(a.bytes, 0)) / 1024 / 1024 / 1024, 0) free_GB, round((sum(b.bytes) - sum(nvl(a.bytes, 0))) / sum(b.bytes), 4) * 100 use_precent, count(*) from (select tablespace_name, file_id, sum(bytes) bytes from adm_free_space groupby tablespace_name, file_id) a, adm_data_files b where a.file_id(+) = b.file_id and a.tablespace_name(+) = b.tablespace_name groupby b.tablespace_name having round((sum(b.bytes) - sum(nvl(a.bytes, 0))) / sum(b.bytes), 4) * 100 >= 0 orderby 4 desc; 1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.