ITPub博客

首页 > 数据库 > Oracle > 表空间查询信息

表空间查询信息

原创 Oracle 作者:贺子_DBA时代 时间:2014-12-31 17:30:22 0 删除 编辑
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 5. 还有在命令行情况下如何将结果放到一个文件里。 SQL> spool out.txt SQL> select * from v$database; SQL> spool off

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29654823/viewspace-1386364/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
10年数据库管理员从业经历,熟悉Oracle、mysql、tidb、oceanbase、redis、 mongodb 、python等技术栈,持有11g ocm 、mysql 5.7 ocp 、tidb 5.0 ptcp、tidb 6.0 ptca、oceanbase obcp等

注册时间:2014-05-12

  • 博文量
    327
  • 访问量
    2148915