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 > Determine the size of a DB2 table

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-03-07, 11:19
bustacap bustacap is offline
Registered User
 
Join Date: Apr 2007
Posts: 9
Determine the size of a DB2 table

Hi there,

We are using DB2 version 8 fixpack 10 on AIX. All table spaces are SMS, actuall... we just have 1 tablespace that contains all the tables. How do I determine the physical size of just one of the tables in the tablespace? I believe I can use db2 inspect but that takes a very long time on a large database. Just wondering if there was an easier way? Thanks.
Reply With Quote
  #2 (permalink)  
Old 10-03-07, 13:14
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Code:
D:\>db2 get snapshot for tables on ???

            Table Snapshot

First database connect timestamp     = 10/01/2007 13:38:13.188694
Last reset timestamp                 =
Snapshot timestamp                   = 10/03/2007 13:03:40.319739
Database name                        = ???
Database path                        = D:\DB2\NODE0000\SQL00001\
Input database alias                 = ???
Number of accessed tables            = 62

Table List
 Table Schema        = SYSIBM
 Table Name          = SYSTABLES
 Table Type          = Catalog
 Data Object Pages   = 155
 Index Object Pages  = 71
 LOB Object pages    = 5376
 Rows Read           = Not Collected
 Rows Written        = 1156
 Overflows           = 6546
 Page Reorgs         = 0
Reply With Quote
  #3 (permalink)  
Old 10-03-07, 14:00
bustacap bustacap is offline
Registered User
 
Join Date: Apr 2007
Posts: 9
Thanks a lot! Now I just have to figure out how big a disk page is.
Reply With Quote
  #4 (permalink)  
Old 10-03-07, 14:53
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
It's not a disk page, it's the tablespace page.

Code:
select tabschema, tabname, pagesize 
from syscat.tables t, syscat.tablespaces s 
where t.tbspaceid = s.tbspaceid
Reply With Quote
  #5 (permalink)  
Old 10-03-07, 16:04
bustacap bustacap is offline
Registered User
 
Join Date: Apr 2007
Posts: 9
Thanks for clearing that up! I was looking at this document and it referred to it as a "disk page". Oh well...

http://publib.boulder.ibm.com/infoce...n/r0011337.htm

Thanks again!
Reply With Quote
  #6 (permalink)  
Old 10-09-07, 17:39
rubystep rubystep is offline
Registered User
 
Join Date: Sep 2003
Posts: 85
How about REORGCHK UPDATE STATISTICS ON TABLE schema.table and check the TSIZE column for the table?
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