Results 1 to 4 of 4

Thread: Table size

  1. #1
    Join Date
    May 2012
    Location
    Chennai
    Posts
    45

    Smile Unanswered: Table size

    Hi All,

    Can you tell how to calculate the table size for individual table?

    I have a command. whether it is right or not

    >db2 "select b.tabname,(((b.card * (sum(avgcollen)+10))/1024)/1024) as Tsize_mb from syscat.columns a, syscat.tables b where a.tabschema = 'your schema' and a.tabname = b.tabname and a.tabschema = b.tabschema group by b.tabname, b.card"
    thanks

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    http://www.dbforums.com/db2/1664615-...2-9-5-a-2.html

    You can find a lot of info and answer to simple questions by visiting here . The string "db2 table size" would have done the trick.
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  3. #3
    Join Date
    May 2012
    Location
    Chennai
    Posts
    45
    yes correct, I got some different commands for table size from google.
    I want to know which one is correct because all sizes are different for a table, If i using that those commands

  4. #4
    Join Date
    Nov 2011
    Location
    Chennai
    Posts
    27
    Table Size:-
    db2 "select char(date(t.stats_time))||' '||char(time(t.stats_time)) as statstime ,substr(t.tabschema,1,8)||'.'||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 with ur"
    To find the largest tables
    db2 "Select name, card from sysibm.systables where card > 1000000 order by card desc" | more

Posting Permissions

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