select a.tablespace_name "表空間名",
total "表空間大小",
free "表空間剩餘大小",
(total - free) "表空間使用大小",
total / (1024 * 1024 * 1024) "表空間大小(g)",
free / (1024 * 1024 * 1024) "表空間剩餘大小(g)",
(total - free) / (1024 * 1024 * 1024) "表空間使用大小(g)",
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;
select m.segment_name "表名稱",
m.segment_type "表型別",
m.size1 "占用空間(m)",
m.tablespace_name "表空間"
from (select t.segment_name,
t.segment_type,
t.tablespace_name,
sum(t.bytes / 1024 / 1024) as size1
from dba_segments t
where t.segment_type = 'table'
-- and t.tablespace_name = '' -- 表空間條件
group by owner, t.segment_name, t.segment_type,t.tablespace_name) m
order by size1 desc;
Oracle 檢視表空間大小 小總結
1.方式一 表空間名和大小 select t.tablespace name,round sum bytes 1024 1024 0 ts size from dba tablespaces t,dba data files d where t.tablespace name d.tablespac...
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 ...
oracle檢視表空間情況
查詢表空間的總容量 select tablespace name 表空間名稱,sum bytes 1024 1024 表空間總容量mb 查詢表空間使用率 select total.tablespace name 表空間名稱,round total.mb,2 總容量mb,round total.mb ...