ORACLE 查询表空间使用情况
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;//清空所有用戶的回收站
?
總結(jié)
以上是生活随笔為你收集整理的ORACLE 查询表空间使用情况的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Java发送邮件(带附件)
- 下一篇: java虚拟机之内存分配