Skip to content
Advertisements

dbms_space displaying information about space usage

Oracle Database provides data dictionary views and PL/SQL packages that allow you to display information about the space usage of schema objects.

DBMS_SPACE : refer here

Just a example :

SQL> VARIABLE total_blocks NUMBER
SQL> VARIABLE total_bytes NUMBER
SQL> VARIABLE unused_blocks NUMBER
SQL> VARIABLE unused_bytes NUMBER
SQL> VARIABLE lastextf NUMBER
SQL> VARIABLE last_extb NUMBER
SQL> VARIABLE lastusedblock NUMBER

SQL> exec DBMS_SPACE.UNUSED_SPACE('SCOTT', 'EMP', 'TABLE', :total_blocks,:total_ bytes,:unused_blocks,:unused_bytes, :lastextf,:last_extb, :lastusedblock);

PL/SQL procedure successfully completed.

SQL> print

TOTAL_BLOCKS
------------
8
TOTAL_BYTES
-----------
65536
UNUSED_BLOCKS
-------------
4
UNUSED_BYTES
------------
32768
LASTEXTF
----------
4
LAST_EXTB
----------
144
LASTUSEDBLOCK
-------------
4

SQL>
Advertisements
No comments yet

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: