Topic
  • 1 reply
  • Latest Post - ‏2012-07-03T07:22:28Z by Ievarats
ssow
ssow
1 Post

Pinned topic Table size

‏2012-05-31T10:46:27Z |
Hi All,

How to get size of the table? I have searched table size from google. It shows some commands but all size values are different for a table when i use that queries. So Please can you suggest which one is correct. Please, find the below commands
--Table size
>db2 SELECT TABSCHEMA, TABNAME, DATA_OBJECT_P_SIZE + INDEX_OBJECT_P_SIZE + LONG_OBJECT_P_SIZE + LOB_OBJECT_P_SIZE + XML_OBJECT_P_SIZE AS TOTAL_SIZE FROM SYSIBMADM.ADMINTABINFO WHERE TABNAME = 'T11'

>db2 "select substr(a.tabname,1,30), (a.fpages*PAGESIZE/1024) as size_k,a.card from syscat.tables a, syscat.tablespaces b where a.TBSPACEID=b.TBSPACEID and a.tabname='<tab_name>' and tabschema='<schema_name>' "

>db2 "select substr(a.tabname,1,30), (a.fpages*PAGESIZE/1024) as size_k,a.card from syscat.tables a, syscat.tablespaces b where a.TBSPACEID=b.TBSPACEID and a.tabname='<tab_name>' and tabschema='<schema_name>' "
Updated on 2012-07-03T07:22:28Z at 2012-07-03T07:22:28Z by Ievarats