dbTalk Databases Forums  

How to measure tablespace fragmentation

comp.databases.ibm-db2 comp.databases.ibm-db2


Discuss How to measure tablespace fragmentation in the comp.databases.ibm-db2 forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Desmodromic
 
Posts: n/a

Default How to measure tablespace fragmentation - 08-19-2011 , 08:39 PM






I suspect that the containers of certain tablespaces in our DB2 9.5
FP7 database are very fragmented. What I believe has happened is that
the tablespaces have been created small in size with AUTORESIZE YES
and a very small INCREASESIZE.

What I would like to obtain for each tablespace, since it was created,
is a report of the initial size and the size and number of all
subsequent extends (automatic and manual).

Does anyone know if this can be done?

Reply With Quote
  #2  
Old   
Lennart Jonsson
 
Posts: n/a

Default Re: How to measure tablespace fragmentation - 08-20-2011 , 03:00 AM






On 2011-08-20 03:39, Desmodromic wrote:
Quote:
I suspect that the containers of certain tablespaces in our DB2 9.5
FP7 database are very fragmented. What I believe has happened is that
the tablespaces have been created small in size with AUTORESIZE YES
and a very small INCREASESIZE.

What I would like to obtain for each tablespace, since it was created,
is a report of the initial size and the size and number of all
subsequent extends (automatic and manual).

Does anyone know if this can be done?
I don't know the answer to your question, but I would suggest that you
focus on the tables in the tablespace (AFAIK you can't do much about it
at tablespace level anyhow). The need for reorg on tables can be
determined by the amount of overflow in each table. Something like:

select a.tabname, a.rows_read, a.overflow_accesses,
cast(((a.overflow_accesses * 100.0) / nullif(a.rows_read, 0))
as decimal (5,2)) AS percent_overflow_reads
from sysibmadm.snaptab a
join syscat.tables b
on (a.tabschema, a.tabname) = (b.tabschema, b.tabname)
where b.tbspace = ? order by 4 desc

A rule of thumb is 3%



/Lennart

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.