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
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
我对库做了一次备份,然后在另一个数据库里恢复.结果只有4G不到(原库显示是20G,不管我再怎么删除数据都是20G).