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 Size

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-14-10, 06:38
LEARNING DBA LEARNING DBA is offline
Registered User
 
Join Date: Oct 2010
Posts: 3
DB2 Size

I have a table Say X and let the table conatins around 9 million records. How do I calucalte exactly how much GB/MB the table uses in DASD. I am always having trobule in this
Reply With Quote
  #2 (permalink)  
Old 10-14-10, 07:34
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Multiply the number of table pages from SYSCAT.TABLES by the tablespace page size in SYSCAT.TABLESPACES.
Reply With Quote
  #3 (permalink)  
Old 10-14-10, 07:56
LEARNING DBA LEARNING DBA is offline
Registered User
 
Join Date: Oct 2010
Posts: 3
Thanks

So if have NPAGES =1000 and Page SIZe = 4 then total size should be 4000KB . Am I thinking correct ?
Reply With Quote
  #4 (permalink)  
Old 10-15-10, 09:28
Cougar8000 Cougar8000 is offline
Registered User
 
Join Date: Nov 2005
Location: IL
Posts: 554
You also might want to look into SYSIBMADM.ADMINTABINFO
__________________
--
IBM Certified DBA on DB2 for Linux, UNIX, and Windows

DB2 v9.1.0.2 os 5.3.0.0
Reply With Quote
  #5 (permalink)  
Old 11-23-10, 05:10
harshrpce harshrpce is offline
Registered User
 
Join Date: Nov 2010
Posts: 12
try this query

db2 "select char(date(t.stats_time))||' '||char(time(t.stats_time)) as statstime ,substr(t.tabschema,1,4)||'.'||substr(t.tabname,1, 24) as tabname , card as rows_per_table , decimal(float(t.npages)/ ( 1024 / (b.pagesize/1024)),9,2) as used_mb , decimal(float(t.fpages)/ ( 1024 / (b.pagesize/1024)),9,2) as allocated_mb from syscat.tables t , syscat.tablespaces b where t.tbspace=b.tbspace" | grep -i tablename

This will give you the list of tables and their size and size allocated to them in MB..


--Harsh
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