zl程序教程

您现在的位置是:首页 >  数据库

当前栏目

在Oracle中查询表的大小

Oracle 查询 大小
2023-09-27 14:25:11 时间

SELECT segment_name AS TABLENAME,round(BYTES/1024/1024,2)  FROM user_segments WHERE segment_name='表名'。  查出来的是M为单位;

 

 

select tt1.table_name,
tt1.length1,
tt2.rownums,
round(tt1.length1 * tt2.colnum * tt2.rownums / 1024 / 1024, 2) as sum_MB
from (select t.table_name, sum(t.DATA_LENGTH) as length1
from dba_tab_columns t, ecp_temp t1
where t.owner = 'BIDPRO'
and t.table_name = t1.tablename
group by t.table_name) tt1,

ecp_temp tt2
where tt1.table_name = tt2.tablename;