SELECT a.tablespace_name ,--表空间
Round(a.bytes/(1024*1024*1024),3),-- 大小G
Round(b.bytes/(1024*1024*1024)), --已使用G
Round(c.bytes/(1024*1024*1024)) ,--剩余G
Round(b.bytes*100/a.bytes,3), --使用百分比%
Round(c.bytes*100/a.bytes,3) --剩余百分比%
FROM sys.Sm$ts_Avail a, sys.Sm$ts_Used b,sys.sm$ts_free c
WHERE a.tablespace_name=b.tablespace_name AND a.tablespace_name=c.tablespace_name;
1.查询表空间使用情况
select a.segment_name, sum(a.BYTES) / 1024 / 1024 / 1024
from dba_segments a
where owner='AML' and a.tablespace_name = 'TSIND01'
group by a.segment_name
order by sum(a.BYTES) / 1024 / 1024 / 1024;
2.
select * from user_cons_columns;
select * from dba_tablespace_usage_metrics where tablespace_name = 'TSIND01';
3.查看回收站
select * from user_recyclebin;
4.清空回收站
purge recyclebin;//清空用户回收站
purge index ;//清空索引回收站
purge table ;//清空表回收站
purge recyclebin;//清空所有用户的回收站