Pavan DBA's Blog

The DBA Knowledge Store

Script to know used blocks information

Posted by Pavan DBA on February 23, 2012


*********************************

To know used blocks information

*********************************

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(‘SYSTEM’, ‘TEST’, ‘TABLE’,

TOTAL_BLOCKS, TOTAL_BYTES, UNUSED_BLOCKS, UNUSED_BYTES,

LAST_USED_EXTxENT_FILE_ID, LAST_USED_EXTENT_BLOCK_ID,

LAST_USED_BLOCK);

 

dbms_output.put_line(‘OBJECT_NAME = CUSTOMER’);

dbms_output.put_line(‘———————-‘);

dbms_output.put_line(‘TOTAL_BLOCKS = ||TOTAL_BLOCKS);

dbms_output.put_line(‘UNUSED_BLOCKS = ‘||UNUSED_BLOCKS);

end;

/

 

Advertisements

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: