在Oracle中查詢表的大小


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;


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM