dbms_space


set serveroutput on
declare
 total_blocks NUMBER ;
 total_bytes NUMBER ;
 unused_blocks NUMBER;
 unused_bytes NUMBER ;
 last_used_extent_file_id NUMBER ;
 last_used_extent_block_id NUMBER ;
 last_used_block NUMBER ;
BEGIN
 dbms_space.unused_space('&Username','&Table_Name' ,'TABLE' , total_blocks,total_bytes, unused_blocks ,unused_bytes,
 last_used_extent_file_id ,
 last_used_extent_block_id ,
 last_used_block,
 '&Partition_Name' 
 );
dbms_output.put_line( '********************************************************************************'); 
dbms_output.put_line( 'total number of blocks in the segment :'||TO_CHAR(total_blocks) );
dbms_output.put_line( 'Total Mbytes :'||TO_CHAR(total_bytes/1024/1024) ); 
dbms_output.put_line( 'number of blocks which are not used :'||TO_CHAR(unused_blocks/1024/1024) ); 
dbms_output.put_line( 'Unused MBytes : :'||TO_CHAR(unused_bytes/1024/1024) );
dbms_output.put_line( 'the file ID of the last extent which contains data :'||TO_CHAR(last_used_extent_file_id ) );
dbms_output.put_line( 'the block ID of the last extent which contains data :'||TO_CHAR(last_used_extent_block_id ) );
dbms_output.put_line( 'the last block within this extent which contains data :'||TO_CHAR(last_used_block) );
dbms_output.put_line( '******************************************************************************* ');
 
 
END ;
/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: