db2大表統計

flywiththewind發表於2018-09-27

db2 "

select t1.*,nvl(substr(t2.DATAPARTITIONEXPRESSION,1,30),'NULL')  PARTITIONKEY from

(select trim(substr(t1.tabschema,1,20)) tabschema,substr(t1.tabname,1,30) tabname,

sum(DATA_OBJECT_L_SIZE +

INDEX_OBJECT_L_SIZE+

LONG_OBJECT_L_SIZE +

LOB_OBJECT_L_SIZE  +

XML_OBJECT_L_SIZE)  L_SIZE,

sum(DATA_OBJECT_P_SIZE +

INDEX_OBJECT_P_SIZE+

LONG_OBJECT_P_SIZE +

LOB_OBJECT_P_SIZE  +

XML_OBJECT_P_SIZE)  P_SIZE from sysibmadm.admintabinfo t1

group by trim(substr(t1.tabschema,1,20)),substr(t1.tabname,1,30) 

order by 3 desc,4 desc fetch first 30 rows only)t1

left join SYSIBM.SYSDATAPARTITIONEXPRESSION t2

on t1.TABSCHEMA=t2.TABSCHEMA

and t1.tabname=t2.tabname with ur"


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26224914/viewspace-2215064/,如需轉載,請註明出處,否則將追究法律責任。

相關文章