Results 1 to 5 of 5

Thread: DB2 Size

  1. #1
    Join Date
    Oct 2010
    Posts
    3

    Unanswered: 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

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Multiply the number of table pages from SYSCAT.TABLES by the tablespace page size in SYSCAT.TABLESPACES.

  3. #3
    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 ?

  4. #4
    Join Date
    Nov 2005
    Location
    IL
    Posts
    557
    You also might want to look into SYSIBMADM.ADMINTABINFO
    --
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows

    DB2 v9.7.0.6 os 6.1.0.0

  5. #5
    Join Date
    Nov 2010
    Posts
    21
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •