If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > DB2 Tablespace page szie

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-20-12, 13:33
db2mtrk db2mtrk is offline
Registered User
 
Join Date: Nov 2011
Posts: 71
DB2 Tablespace page szie

Hi,
we have two version of databases running on windows.
db2 v8.2 and db2 v9.7 fp 3a.

in v8.2 there is a dms tablespace with 8K page. Only one table in this TBS.
the average row length is 165 bytes. how do I calculate that we are wasting any space or not?

In v9.7 same tablespace with 4K page. again the row length is 165 bytes.
Again I need to see this will fit correctly into the page.

Please advise.

Thanks.
Reply With Quote
  #2 (permalink)  
Old 04-20-12, 13:51
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 4,011
You need the cardinality of the table and the number of pages used by the table. This will give you the rows per page. Then multiply by the average row length then subtract that result from the page size. That is about how much wasted space you will have per page.

Andy
Reply With Quote
  #3 (permalink)  
Old 04-20-12, 14:18
db2mor db2mor is offline
Registered User
 
Join Date: Apr 2012
Posts: 390
Depends on whether or not you will use the row-compression feature in v9.7
or any simpler compression techniques.
You don't mention whether your workload is DSS/BI or OLTP.
For OLTP you might want fewer rows per extent, but for DSS perhaps the opposite.
Reply With Quote
  #4 (permalink)  
Old 04-20-12, 15:31
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,477
Quote:
Originally Posted by db2mtrk View Post
Hi,
we have two version of databases running on windows.
db2 v8.2 and db2 v9.7 fp 3a.

in v8.2 there is a dms tablespace with 8K page. Only one table in this TBS.
the average row length is 165 bytes. how do I calculate that we are wasting any space or not?

In v9.7 same tablespace with 4K page. again the row length is 165 bytes.
Again I need to see this will fit correctly into the page.

Please advise.

Thanks.
With a row size of 165, you can not possibly be wasting any amount of space that is even worth worrying about, regardless of page size.

What is more import, is how the data is typically accessed and how many rows are in the table. If the data is almost always accessed a few rows (or one row) at at time via an index, 4K or 8K page size is fine. If the table has a large number of rows which are typically accessed via table scan, then larger page sizes are better, maybe even 32K.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #5 (permalink)  
Old 04-20-12, 16:52
db2mtrk db2mtrk is offline
Registered User
 
Join Date: Nov 2011
Posts: 71
Thanks so much for your comments.
yes, the workload is OLTP.

what i heard is, only 255 rows can store in a page. It means only 32 bytes data can store in a row on 8K page. in that basis, how can I work out that I am wasting any page?
Reply With Quote
  #6 (permalink)  
Old 04-20-12, 16:56
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 4,011
The MAXIMUM number of rows per page is 255 (for a regular tablespace). That does not mean that the rows have to be 32 bytes in length. If you rows, like yours are 165 bytes, then you will have approximately 49 rows per page. Your unused space per page would be less than 80 bytes.

Andy
Reply With Quote
  #7 (permalink)  
Old 04-20-12, 17:31
db2mtrk db2mtrk is offline
Registered User
 
Join Date: Nov 2011
Posts: 71
Thanks Andy. I got it now.

Really helpfull information.
Thanks all again.
Reply With Quote
  #8 (permalink)  
Old 04-20-12, 18:12
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,477
For newly created tablespaces in 9.7 the default is LARGE tablespace, which is not limited to 255 rows per page. For a variety of other reasons, I would recommend migrating any tables created in old tablespaces prior to 9.7 to a newly created 9.7 LARGE tablespace.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #9 (permalink)  
Old 04-22-12, 11:16
db2mtrk db2mtrk is offline
Registered User
 
Join Date: Nov 2011
Posts: 71
Thanks Marcus.
Any db2 tools or commands available to migrate the v8.2 TBS to V9.7 ?

I think only way to migrate the TBS is, Alter to LARGE type then REORG the tables and Indexes.

OR, create new LARGE TABLESPACE then move all the tables/indexes using ADMIN_TABLE_MOVE funcation.

OR Export and Import.

Our system is almost 24/7, also HADR is in place. however we have 12 hour weekly maintenance windown. So I will be able to use this window for this work.

Which option is more stright forward ?

Thanks.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On