Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / February 2006

Tip: Looking for answers? Try searching our database.

Current and Estimate Table Data Size and Index Size for DB2

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
stabbert - 09 Feb 2006 14:01 GMT
We are on DB2 UDB 8.2.2 on AIX.  I know this question has been asked
many times on the ng but I am just not finding a real good answer.  I
need to be able to not only determine existing table data size and
index size but also estimate for the future.  I keep seeing info
regarding using reorgchk and the such however my dba will not allow us
developers to have access to the comands necessary such as runstats.
How can a lowely developer such as myself get acess to the information
I need.

In a perfect world what I would like to have is a query/stored proc
that I might use which I feed it schema name and table name which would
return back to me how much space is used by data and indexes.  Another
query/stored proc  which would be useful is one to feed it again schema
name and table name and number of rows which would then output
estimated data size and index size that would be used by that number of
rows.

I also saw this Query out on the ng but I don't have privs to
SYSTOOLS.STMG_OBJECT.

   SELECT
     MAX(tables.STMG_TIMESTAMP) as SNAPSHOT_TIMESTAMP,
     tables.OBJ_ID,
     object.OBJ_NAME,
     object.obj_schema,
     tables.ESTIMATED_SIZE
     FROM
     SYSTOOLS.STMG_TABLE tables
     INNER JOIN
     SYSTOOLS.STMG_OBJECT object
     ON tables.obj_id = object.obj_id AND tables.stmg_timestamp =
     object.stmg_timestamp
     GROUP BY tables.STMG_TIMESTAMP, tables.ESTIMATED_SIZE,
tables.obj_id,
     object.obj_name, object.obj_schema

Any help would be appreciated!
Spencer
Serge Rielau - 09 Feb 2006 14:59 GMT
> We are on DB2 UDB 8.2.2 on AIX.  I know this question has been asked
> many times on the ng but I am just not finding a real good answer.  I
[quoted text clipped - 34 lines]
> Any help would be appreciated!
> Spencer

Table look at SYSCAT.TABLES and SYSCAT.COLUMNS. From the cardinality and
the various sizes it's easy to compute size.

Cheers
Serge
Signature

Serge Rielau
DB2 Solutions Development
DB2 UDB for Linux, Unix, Windows
IBM Toronto Lab

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.