查看表空间的容量

原创 2013年12月02日 16:55:20
set line 300 pages 2000

Select d.tablespace_name,
       Space "Sum_space(M)",
       Blocks sum_blocks,
       Space - nvl(free_space, 0) "Used_space(M)",
       round((1 - nvl(free_space, 0) / Space) * 100, 2) "Used_rate(%)",
       free_space "Free_space(M)"
  From (Select tablespace_name,
               round(Sum(bytes) / (1024 * 1024), 2) Space,
               Sum(blocks) Blocks
          From dba_data_files
         Group By tablespace_name) d,
       (Select tablespace_name,
               round(Sum(bytes) / (1024 * 1024), 2) free_space
          From dba_free_space
         Group By tablespace_name) f
 Where d.tablespace_name = f.tablespace_name(+)
Union All
Select d.tablespace_name,
       Space "Sum_space(M)",
       blocks sum_blocks,
       used_space "Used_space(M)",
       round(nvl(used_space, 0) / Space * 100, 2) "Used_rate(%)",
       nvl(free_space, 0) "Free_space(M)"
  From (Select tablespace_name,
               round(Sum(bytes) / (1024 * 1024), 2) Space,
               Sum(blocks) blocks
          From dba_temp_files
         Group By tablespace_name) d,
       (Select tablespace_name,
               round(Sum(bytes_used) / (1024 * 1024), 2) used_space,
               round(Sum(bytes_free) / (1024 * 1024), 2) free_space
          From v$temp_space_header
         Group By tablespace_name) f
 Where d.tablespace_name = f.tablespace_name(+);



--------eg.
TABLESPACE_NAME                        Sum_space(M)           SUM_BLOCKS        Used_space(M)         Used_rate(%)        Free_space(M)
------------------------------ -------------------- -------------------- -------------------- -------------------- --------------------
BOSSDATA                                     784248            100383744            187199.44                23.87            597048.56
SYSTEM                                         2047               262016                299.5                14.63               1747.5
UNDOTBS1                                      40867              5230976              1192.06                 2.92             39674.94
TEMP                                          16380              2096640                11786                71.95                 4594


版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

oracle数据库报ora-01691错误--表空间容量溢出解决办法

今天又遇到了新的数据库问题,后台添加数据,报ora-01691错误, 刚好有截图,贴出来大家参考下,之后就开始网上搜方法,也没找到具体解决办法,只是大概知道了问题的原因!因为是数据库,不敢乱...

oracle 查看用户所在的表空间

查看当前用户的缺省表空间   SQL>select username,default_tablespace from user_users;   查看当前用户的角色   SQL>select *...

查看所有表空间大小

  • 2014-08-18 20:04
  • 557KB
  • 下载

oracle查看用户所在表空间

1、查看当前用户的缺省表空间select username,default_tablespace,temporary_tablespace from user_users; 2、查看当前用户的角色s...

oracle查看表空间

1、查看表空间的名称及大小   select t.tablespace_name, round(sum(bytes/(1024*1024)),0) ts_size from dba_tables...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)