If you want to see a more visual representation of what's in a tablespace
(including free space) use the mapper.sql from the old DBA Handbook (don't
have it right here in front of me so I don't know the author's name).  This
is for Oracle 7.3.4.

--------------------------------------------------------------------------
rem
rem file: mapper.sql
rem parameters: the tablespace name being mapped
rem
rem Sample invocation:
rem @mapper SYSTEM
rem
rem This script generates a mapping of the space usage
rem (free space vs used) in a tablespace. It graphically
rem shows segment and free space fragmentation.
rem
set pagesize 66 linesize 132 verify off
ttitle 'Map of Tablespace ' &&1 right datevar skip 1
column substr(file_id,1,4) heading "File|Id"
column bytes format 999,999,999,999
column today noprint new_value datevar

SELECT
to_char(sysdate, 'MM/DD/YY') today,
'free space' owner, /*"owner" of free space*/
' ' object, /*blank object name*/
substr(file_id,1,4), /*file ID for the extent header*/
block_id, /*block ID for the extent header*/
blocks, /*lengthof the extent in blocks*/
bytes /*length of the extent in bytes*/
FROM sys.dba_free_space
WHERE tablespace_name = upper('&&1')
UNION
SELECT
to_char(sysdate, 'MM/DD/YY') today,
substr(owner,1,10), /*owner name (first 20 chars)*/
substr(segment_name,1,27), /*segment name (first 26 chars)*/
substr(file_id,1,4), /*file ID for extent header*/
block_id, /*block ID for block header*/
blocks, /*length of the extent in blocks*/
bytes /*length of the extent in bytes*/
FROM sys.dba_extents
WHERE tablespace_name = upper('&&1')
ORDER BY 4,5

/
undefine 1
----------------------------------------------------------------------------------------------

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: 
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to