Oracle Technology Blog

OraTech Blog provides tips,tricks,scripts and how-to type answers for Oracle related technologies. I use these commands very often, so I thought it would be useful to share with everybody. Please feel free to include your comments/corrections/questions.

Friday, October 12, 2007

Tablespace- How much I can shrick?

select
a.tablespace_name,
a.file_id,
a.file_name,
a.bytes file_size_in_bytes,
(c.block_id+(c.blocks-1)) * &block_size HWM_BYTES,
a.bytes - ((c.block_id+(c.blocks-1)) * &block_size) SAVING
from dba_data_files a,
(select file_id,max(block_id) maximum
from dba_extents
group by file_id) b,
dba_extents c
where a.file_id = b.file_id
and c.file_id = b.file_id
and c.block_id = b.maximum
order by 6;


0 Comments:

Post a Comment

<< Home