檢視oracle表空間大小

2021-06-09 00:15:09 字數 1052 閱讀 4663

select upper(f.tablespace_name) "表空間名",

d.tot_grootte_mb "表空間大小(m)",

d.tot_grootte_mb - f.total_bytes "已使用空間(m)",

to_char(round((d.tot_grootte_mb - f.total_bytes) /

d.tot_grootte_mb * 100,

2),'990.99') "使用比",

f.total_bytes "空閒空間(m)",

f.max_bytes "最大塊(m)"   from (select tablespace_name,

round(sum(bytes) /

(1024 * 1024),

2) total_bytes,

round(max(bytes) /

(1024 * 1024),

2) max_bytes   from sys.dba_free_space   group by tablespace_name) f,

(select dd.tablespace_name,

round(sum(dd.bytes) / (1024 * 1024), 2) tot_grootte_mb   from sys.dba_data_files dd   group by dd.tablespace_name) d   where d.tablespace_name = f.tablespace_name   order by 4 desc

查詢結果:

檢視oracle表空間大小

1.檢視所有表空間大小 sql select tablespace name,sum bytes 1024 1024 from dba data files group by tablespace name 2.已經使用的表空間大小 sql select tablespace name,sum by...

oracle 表空間及表大小檢視

今天看資料庫的表空間,感覺賽了很多東西,表空間檔案太大了。找了下資料,先查詢表所佔空間大小,使用如下語句檢視 select segment name,sum bytes 1024 1024 mbytese from user segments where segment type table gro...

oracle表空間及表大小檢視

oracle表空間及表大小檢視 今天看資料庫的表空間,感覺賽了很多東西,表空間檔案太大了。找了下資料,先查詢表所佔空間大小,使用如下語句檢視 sql select segment name,sum bytes 1024 1024 mbytese from user segments where se...