472,348 Members | 1,238 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,348 software developers and data experts.

Current and Estimate Table Data Size and Index Size for DB2

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

Feb 9 '06 #1
1 4676
stabbert wrote:
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

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

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
DB2 UDB for Linux, Unix, Windows
IBM Toronto Lab
Feb 9 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Matt Liverance | last post by:
I REALLY dont want to switch to oracle :( but I cant get these tables working any faster. I've got 2 dedicated servers, each with a slave, all...
1
by: Jay | last post by:
Hi I have a huge table with over 100million records and on regular basis ineed to delete nearly a million records and insert a million records....
7
by: sql-db2-dba | last post by:
Does DB2 just fudge it when it is an empty table? Is there a "formula" for average row size when you have variable length records. Or you really...
12
by: xixi | last post by:
hi, i am using db2 udb v8.1 on windows, i try to use control center to estimate table size, but some of them showing 0 rows even though there are...
4
by: Fan Ruo Xin | last post by:
How to estimate the size of log space when I need to run "INSERT INTO tgt_tbl SELECT * FROM src_tbl WHERE..." ? What is the difference of before...
3
by: MLH | last post by:
Precise determinations are not the objective. I would lke a single button click approach to creating a report/table/dynaset - whatever - to...
0
by: Ben | last post by:
module main ... application.run(new splashform) .. end module after a few screen, I try to load a new codes I got from MSDN on datagrid that...
8
by: rshivaraman | last post by:
Hi : I have a TableA with around 10 columns with varchar and numeric datatypes It has 500 million records and its size is 999999999 KB. i...
4
by: Alvin SIU | last post by:
Hi all, I am now doing development using DB2. Q1. There is one tablespace to store 5 tables. But, when in production, there will be one...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.