I want to find the size of Table
, Data_Space_Used
, Index_Space_Used
, Unused_Space
etc but exec sp_spaceused
开发者_StackOverflow doesn't work.
I need to define first the table with columns as referred above?
If this is for Oracle:
Space allocated to tables and indexes:
select owner, segment_type, segment_name, sum(bytes)
from dba_segments
group by owner, segment_type, segment_name;
Free space:
select tablespace_name, sum(bytes) from dba_free_space group by tablespace_name;
Another more detailed query here: http://asktom.oracle.com/pls/asktom/ASKTOM.download_file?p_file=6551402703363001567
精彩评论