P. 1
Oracle - TableSpace Free

Oracle - TableSpace Free

|Views: 6|Likes:
Published by oracle412
oracle foreign key primary key constraints performance tuning MTS IOT 9i block size backup rman corrupted column drop rename recovery controlfile backup clone architecture database archives export dump dmp duplicate rows extents segments fragmentation hot cold blobs migration tablespace locally managed redo undo new features rollback ora-1555 shrink free space user password link TNS tnsnames.ora listener java
oracle foreign key primary key constraints performance tuning MTS IOT 9i block size backup rman corrupted column drop rename recovery controlfile backup clone architecture database archives export dump dmp duplicate rows extents segments fragmentation hot cold blobs migration tablespace locally managed redo undo new features rollback ora-1555 shrink free space user password link TNS tnsnames.ora listener java

More info:

Published by: oracle412 on Jun 17, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

12/14/2015

pdf

text

original

Free Space in a Tablespace

Administration Tips

Finding the amount of used and free space in a Tablespace
The following bit of SQL will do the trick:
SELECT TABLESPACE_NAME, ROUND(SUM(TOTAL_MB)-SUM(FREE_MB)) ROUND(SUM(TOTAL_MB))

MB_USED,

MB_SIZE, ROUND((SUM(TOTAL_MB)-SUM(FREE_MB))/SUM(TOTAL_MB)*100) PCT_FULL, ROUND(SUM(MAX_MB) - (SUM(TOTAL_MB)-SUM(FREE_MB))) MB_FREE, ROUND(SUM(MAX_MB)) MB_MAXSIZE, ROUND((SUM(TOTAL_MB)-SUM(FREE_MB))/SUM(MAX_MB)*100) PCT_UTIL
FROM

(SELECT
UNION

TABLESPACE_NAME,SUM(BYTES)/1024/1024 FREE_MB,0 TOTAL_MB,0 MAX_MB

FROM DBA_FREE_SPACE GROUP BY TABLESPACE_NAME SELECT TABLESPACE_NAME,0 CURRENT_MB,SUM(BYTES)/1024/1024 TOTAL_MB, SUM(DECODE(MAXBYTES,

0,

BYTES, MAXBYTES))/1024/1024 MAX_MB

FROM DBA_DATA_FILES GROUP BY TABLESPACE_NAME) GROUP BY TABLESPACE_NAME;

You'll get a report that looks a bit like this:
TABLESPACE_NAME MB_USED MB_SIZE PCT_FULL MB_FREE MB_MAXSIZE PCT_UTIL --------------- ---------- ---------- ---------- ---------- ---------- ----------

INDX SYSTEM UNDOTBS USERS

0 87 1 0

25 325 200 25

0 27 1 0

16384 16297 16383 16384

16384 16384 16384 16384

0 1 0 0

The various columns can be explained thus:
MB_USED: MB_SIZE: PCT_FULL: MB_FREE: MB_MAXSIZE: Total amount of space currently in use within a tablespace Total size of the tablespace, adding up the physical sizes of all datafiles Used divided by Size, expressed as a percentage Total amount of tablespace still sitting there empty This shows how big the tablespace can become. Often this will be the same as the MB_SIZE column -but not if you've switched on autoextend, in which case this column will show the maxsize parameter Size divided by Maxsize expressed as a percentage

PCT_UTIL:

In other words, PCT_FULL shows you what percentage of what you've currently got is being used, whereas PCT_UTIL shows what percentage of the maximum you could possibly *one day* have is being used. Personally, I wouldn't touch autoextend with a barge pole, and I'd be looking to resize or add extra datafiles when the PCT_FULL column is reaching around the 75 - 80% mark.

Copyright © Howard Rogers 2001

10/17/2001

Page 1 of 1

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->