查询表空间的大小

U-北京-小F(846631249)  10:56:22
大家好 查询表空间的大小有什么查询语句吗 
谢谢了
U_keara_CH(609118011)  10:57:47
SELECT a.tablespace_name 表空间,
       total 表空间大小,
       free 表空间剩余大小,
       (total - free) 表空间使用大小,
       round((total - free) / total,
             4) * 100 使用率
  FROM (SELECT tablespace_name,
               SUM(bytes) free
          FROM dba_free_space
         GROUP BY tablespace_name) a,
       (SELECT tablespace_name,
               SUM(bytes) total
          FROM dba_data_files
         GROUP BY tablespace_name) b
 WHERE a.tablespace_name = b.tablespace_name
   --AND a.tablespace_name = upper('appltmp')
   
   
--查询临时表空间

SELECT a.tablespace_name 表空间名,
       total 表空间大小,
       total - used 表空间剩余大小,
       used 表空间使用大小,
       round(used / total,
             4) * 100 使用率
  FROM (SELECT tablespace_name,
               SUM(bytes_used) used
          FROM v$temp_space_header
         GROUP BY tablespace_name) a,
       (SELECT tablespace_name,
               SUM(bytes) total
          FROM dba_temp_files
         GROUP BY tablespace_name) b
 WHERE a.tablespace_name = b.tablespace_name
-- and a.tablespace_name = '查询的临时表空间名称'

原文地址:https://www.cnblogs.com/sumsen/p/2524702.html