1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > 如何查看oracle表空间大小的使用情况 – 数据库 – 前端

如何查看oracle表空间大小的使用情况 – 数据库 – 前端

时间:2021-05-14 01:53:08

相关推荐

如何查看oracle表空间大小的使用情况 – 数据库 – 前端

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) bwhere a.tablespace_name=b.tablespace_name;4. 下面这条语句查看所有segment的大小。

Select Segment_Name,Sum(bytes)/1024/1024 From User_Extents Group By Segment_Name5. 还有在命令行情况下如何将结果放到一个文件里。

SQL> spool out.txtSQL> select * from v$database;SQL> spool off

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。