Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Old Chestnut: Tablespace Fragmentation
rem
rem file: mapper.sql
rem location: $HOME/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, /*length of 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*/
"Browett, Darren" To: Multiple recipients of list ORACLE-L <dbrowett <ORACLE-L_at_fatcity.com> @city.coquitl cc: am.bc.ca> Subject: RE: Old Chestnut: Tablespace Sent by: root Fragmentation 03/01/2002 11:48 AM Please respond to ORACLE-L
Is there anyway to check that the extents are contiguous ?
-----Original Message-----
[mailto:hemantchitale_at_charteredsemi.com]
Sent: February 28, 2002 2:48 AM
To: Multiple recipients of list ORACLE-L
If you have only 1 Table in that Tablespace and only 1 File on that disk,
even if you had multiple extents, you might expect them to be contiguous.
Then, the only issue would be that the extent size should be a proper
multiple
of db_block_size*db_file_multiblock_read_count (or max_io_size).
Hemant K Chitale
Principal DBA
Chartered Semiconductor Manufacturing Ltd
Bill Buchan <wbuchan_at_uk.intasys.com> 27/02/2002 08:43 PM Sent by: root_at_fatcity.com
Please respond to ORACLE-L
To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com>
cc: (bcc: CHITALE Hemant Krishnarao/IT/CHRT/ST Group)
Subject: Old Chestnut: Tablespace Fragmentation
I know this one has been done to death: use uniform extents to avoid fragmentation; multiple extents don't hurt (within limits).
But what if:
Data Warehouse, one big table on a single disk, full table (batch) scan, no
concurrent transactions on the database (so no contention for the disk), no
fragmentation at the file system level, initially empty buffer cache (startup), read-only operation so DBWR isn't doing anything on this disk. Basically I want to read one data file from end to end. Surely it would make sense to have the disk read moving smoothly from one end of the disk to the other rather than bouncing about all over the place as it may do with multiple extents "randomly" allocated.
Any thoughts?
Thanks
- Bill.
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Bill Buchan INET: wbuchan_at_uk.intasys.com 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: ListGuru_at_fatcity.com (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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: hemantchitale_at_charteredsemi.com 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: ListGuru_at_fatcity.com (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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Browett, Darren INET: dbrowett_at_city.coquitlam.bc.ca 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: ListGuru_at_fatcity.com (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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: tday6_at_csc.com 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: ListGuru_at_fatcity.com (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).Received on Fri Mar 01 2002 - 11:24:34 CST