Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Fragmentation level
vs wrote:
>
> How I can evaluate the level of fragmentation in my segment or in my
> entire tablespace?
> Thanks,
> Victor
> slootsky_at_erols.com
Or this . . .
- - - - - - - C U T H E R E - - - - - - - -
SET TERMOUT OFF
SET PAGESIZE 40
SET LINESIZE 90
SET NEWPAGE 0
SET VERIFY OFF SET ECHO OFF
COLUMN sys_id NOPRINT new_value system_id COLUMN sys_date NOPRINT new_value system_date COLUMN sys_user NOPRINT new_value system_user COLUMN rpt_notes FORMAT a100 HEADING 'Notes' COLUMN file_id FORMAT 999 HEADING 'File| ID' COLUMN owner FORMAT a30 TRUNC HEADING 'Owner' COLUMN object FORMAT a32 TRUNC HEADING 'Object' COLUMN block_id FORMAT 9999999 HEADING 'Block|ID' COLUMN blocks FORMAT 999,999,999 HEADING 'Blocks' TTITLE Right 'Date: ' system_date - skip Left 'Database: ' system_id - Center 'Tablespace Usage Mapping' - Right 'User: ' system_user - skip Center '~~~~~~~~~~~~~~~~~~~~~~~~' -skip Left 'Tablespace: ' ts_name -
REPFOOTER -
SKIP 3 -
CENTER '### ## END OF REPORT ## ###'
BTITLE -
SKIP 2 RIGHT 'Page: ' format 99 sql.pno -
SKIP 1 CENTER '### ## Confidential Information -- Dispose of properly
## ###'
SELECT d.name sys_id, to_char(SysDate,'mm/dd/yyyy HH24:MI:SS') sys_date, User sys_user
--SPOOL ts_map.lst
SELECT 'free space' AS owner, ' ' AS object, file_id, block_id, blocks
segment_name, file_id, block_id, blocks
SELECT 'This listing shows the distribution of freespace and objects
within the tablespace. With
it you can identify objects that are barriers between free extents. This
will allow you
to identify objects which, if relocated, will allow free space to be
coalesced into large
contigous extents. Before allocating more file space to a tablespace
you should review
this report to see if objects should be relocated so that existing free
space can be
recaptured.'
AS rpt_notes
FROM DUAL;
--SPOOL OFF
![]() |
![]() |