Discussion:
table's extents
(too old to reply)
s***@dignitas.sk
2007-09-19 10:11:18 UTC
Permalink
Hi all,
how can I find out, how many extents do the table have?

Thanks
b***@to.com
2007-09-19 11:51:02 UTC
Permalink
Hi,

"SELECT NPAGES FROM SYSCAT.TABLES WHERE TABNAME='<table name>'"

could do the trick, if you don't want to use the db2cc (in which case, right-click on the table -> "Estimate size...").

Keep in mind that you have to RUNSTATS on that table before checking the statistics.

Greetings from Stuttgart,
Bogdan
s***@dignitas.sk
2007-09-19 12:18:38 UTC
Permalink
This, displays only the table size, but i am looking for something
which returns the exact number of extents for specific table.
Kelly Schlamb
2007-09-19 13:31:59 UTC
Permalink
Can you be a bit more specific? Are you wanting to include the size of the indexes associated with it, the extent map object(s) (if DMS), etc?
Kelly Schlamb
2007-09-19 14:03:42 UTC
Permalink
In the meantime, there are a few other ways of getting table size. I don't believe that they take the EMP object into consideration (in the case of DMS) but you can use the output to get the size of tables, index objects, etc.

To convert pages to extents just divide by the extent size of the tablespace and round up.

One way is using INSPECT. The output will contain lines like this:

DAT Object Summary: Total Pages 9843 - Used Pages 5465 - Free Space 44 %
INX Object Summary: Total Pages 388 - Used Pages 388

Another way is to use the SYSIBMADM.ADMINTABINFO stored procedure. Further information can be found here:

http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=/com.ibm.db2.udb.admin.doc/doc/r0022024.htm

Regards,
Kelly
s***@dignitas.sk
2007-09-19 14:04:56 UTC
Permalink
Yes, I want to include all table objects that alocate new extents.
In other words the number of all extents related to specific table.
And also if its possible without index extents - only data,long,lob etc. object-extents).

f.e.following table:
create table temp1(id smallint,name varchar(10),notes long varchar,resume blob ....)

And now i want to know how many extents is allocated when the table is created(i know that this can be calculated, but want something automatic)
and for example how many extents is allocated when i insert 100000 record to this table.

thanks
Kelly Schlamb
2007-09-19 14:09:46 UTC
Permalink
In this case, see if the stored procedure I mentioned will help you. Given it can be used in SQL you can aggregate the data as necessary.
s***@dignitas.sk
2007-09-19 14:25:25 UTC
Permalink
Thanks,
its not exactly what i was looking for, but it can help me.

Loading...