首页 > 数据库 >Oracle-查询表大小

Oracle-查询表大小

时间:2022-12-17 21:32:08浏览次数:48  
标签:1024 name sum owner 查询 大小 Oracle segment select

--查找特定表大小

set linesize 200;
col owner for a18;
col segment_name for a28;
select owner,segment_name,sum(bytes / 1024 / 1024) segment_size
from dba_segments
where segment_name = upper('table_name')
group by owner,segment_name;

--查找数据库中占用空间较大的对象

select owner, segment_name, sum(bytes / 1024 / 1024 / 1024) segment_size
from dba_segments
group by owner, segment_name
having sum(bytes / 1024 / 1024 / 1024) > 1
order by 3 desc;

--统计oracle数据库用户所有表的大小

select owner, sum(bytes / 1024 / 1024 / 1024) segment_size
from dba_segments
where segment_name in (select d.object_name
from dba_objects d
where d.object_type = 'TABLE')
group by owner
order by 2 desc;

--查看每个表空间的大小

select tablespace_name, sum(bytes / 1024 / 1024 / 1024) tablespace_size
from dba_segments
group by tablespace_name
order by 2 desc;

标签:1024,name,sum,owner,查询,大小,Oracle,segment,select
From: https://blog.51cto.com/baoyw/5950156

相关文章