Walker News

How To Check DB2 Table Size?

For IBM DB2 v9.x users who would like to find out the total physical disk space used by a table, you can get the estimated table size from SysIbmAdm.AdminTabInfo administrative view.

Besides, DBA can also retrieve logical size of table from AdminTabInfo. For detail information, please refer to IBM DB2 9.7 LUW official guide.
This guide is tested on both DB2 9.7 and DB2 9.1 installed on Redhat Enterprise Linux 5.7.

For example, the following SQL SELECT statement is used to display physical size (Kilobyte) of each table in a database, sorted in ascending order (run it at Linux/Windows command prompt as DB2 CLI command):
db2 "SELECT SUBSTR(TabSchema,1,15), SUBSTR(TabName,1,15), TabType, (Data_Object_P_Size + Index_Object_P_Size + Long_Object_P_Size + Lob_Object_P_Size + Xml_Object_P_Size) as Total_P_Size_KB FROM SysIbmAdm.AdminTabInfo ORDER BY Total_P_Size_KB"

If you only interested in checking table size of particular table or schema, just use WHERE clause to get specific result.

Custom Search

  1. john37 24-04-13@21:53

    Hi thanks ..this query was helpful for me…can u tell me how i can use this to find average table size ..??


2018  •  Privacy Policy