정확한 테이블 사이즈를 확인하기 위해서는
먼저 analyze 구문을 통해 통계 정보를 재작성하고 user_tables 테이블의
num_rows 와 avg_row_len 컬럼을 이용하여 사이즈를 확인한다.




--테이블 단위로 analyze
analyze table 테이블명 compute statistics;

--계정 단위로 analyze
exec dbms_utility.analyze_schema('SCOTT','COMPUTE');


--테이블 사이즈 확인
select 
        table_name, 
        num_rows,
        num_rows * avg_row_len, 
        round((num_rows * avg_row_len/1024/1024),2) "SIZE(Mb)", 
        round((num_rows * avg_row_len/1024/1024/1024),2) "SIZE(Gb)",
        last_analyzed
from user_tables;




+ Recent posts