SQL> select
  2  b.file_id 文件ID号,
  3  b.tablespace_name 表空间名,
  4  b.bytes 字节数,
  5  (b.bytes-sum(nvl(a.bytes,0))) 已使用,
  6  sum(nvl(a.bytes,0)) 剩余空间,
  7  round(sum(nvl(a.bytes,0))/(b.bytes)*100,2) 剩余百分比
  8  from dba_free_space a,dba_data_files b
  9  where a.file_id=b.file_id
 10  group by b.tablespace_name,b.file_id,b.bytes
 11  order by b.file_id
 12  /  文件ID号 表空间名                           字节数     已使用   剩余空间 剩余百分比
---------- ------------------------------ ---------- ---------- ---------- ----------
         1 SYSTEM                          513802240  505348096    8454144       1.65
         2 UNDOTBS1                         36700160   20119552   16580608      45.18
         3 SYSAUX                          293601280  278462464   15138816       5.16
         4 USERS                             6553600    3866624    2686976         41
         5 EXAMPLE                         104857600   81461248   23396352      22.31