查看oracle的表空间使用,查看Oracle的表空间的使用情况
1. 查看所有表空間大小 SQLgt; select tablespace_name,sum(bytes)/1024/1024 from dba_data_files 2 group by tablespace_na
1. 查看所有表空間大小
SQL> select tablespace_name,sum(bytes)/1024/1024 from dba_data_files
2 group by tablespace_name;
2. 查看空閑的表空間大小
SQL> select tablespace_name,sum(bytes)/1024/1024 from dba_free_space
2 group by tablespace_name;
3. 所以使用空間可以這樣計算
select a.tablespace_name,total,free,total-free used from
( select tablespace_name,sum(bytes)/1024/1024 total from dba_data_files
group by tablespace_name) a,
( select tablespace_name,sum(bytes)/1024/1024 free from dba_free_space
group by tablespace_name) b
where a.tablespace_name=b.tablespace_name;
4. 下面這條語句查看所有segment的大小。
Select Segment_Name,Sum(bytes)/1024/1024 From User_Extents Group By Segment_Name
注意查詢的結果都是以M為單位
,
聲明:本文原創發布php中文網,轉載請注明出處,感謝您的尊重!如有疑問,請聯系admin@php.cn處理
總結
以上是生活随笔為你收集整理的查看oracle的表空间使用,查看Oracle的表空间的使用情况的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 来字成语开头的成语有哪些啊?
- 下一篇: linux中用gtk编写的聊天室能运行的