|
|
SELECT a.tablespace_name "tbs_name",
b.file_name "tbs_file",
total "tbs_size",
free "tbs_free",
(total - free) "tbs_used_size",
total / (1024 * 1024 * 1024) "tbs_size(G)",
free / (1024 * 1024 * 1024) "tbs_free(G)",
(total - free) / (1024 * 1024 * 1024) "tbs_can(G)",
round((total - free) / total, 4) * 100 "pct_used %"
FROM (SELECT tablespace_name, SUM(bytes) free
FROM dba_free_space
GROUP BY tablespace_name) a,
(SELECT tablespace_name,file_name, SUM(bytes) total
FROM dba_data_files
GROUP BY tablespace_name,file_name) b
WHERE a.tablespace_name = b.tablespace_name;
|
|