有兩種含義的表大小。一種是分配給一個表的物理空間數量,而不管空間是否被使用。可以這樣查詢獲得字節數:
select segment_name, bytes
from user_segments
where segment_type = 'TABLE';
或者
Select Segment_Name,Sum(bytes)/1024/1024 From User_Extents Group By Segment_Name
另一種表實際使用的空間。這樣查詢:
analyze table emp compute statistics;
select num_rows * avg_row_len
from user_tables
where table_name = 'EMP';
查看每個表空間的大小
Select Tablespace_Name,Sum(bytes)/1024/1024 From Dba_Segments Group By Tablespace_Name