Thread: how would you estimate used container space

1. Registered User
Join Date
Nov 2007
Posts
14

Unanswered: how would you estimate used container space

so, from what i can tell there is no way to tell how full a container is so im trying to find the best way to estimate it...

the method i think is probably the best is to do container total / tabelspace total which gives you a % of how much that container is of the total tablespace.. i then multiply the % and tablespace used which is one way to show how much of that container is used.

from what i've read the containers fill in a round robin way so would it be better to take the total used and divide it by the number of containers?

the second method assumes both containers were created at the same time, and in coding i'd need more error checks because its possible i assign more used than the container even has if the containers are not the same size.

i know to some extent this doesnt really matter because its a matter of how full the tablespace is and not the container, but im trying to visually display drive info and to management, the remaining container space is important.

Thanks
Justin

2. :-)
Join Date
Jun 2003
Location
Posts
5,516
Originally Posted by jrich523
so, from what i can tell there is no way to tell how full a container is
Did you try the tablespace snapshot? Where I live it shows each container utilization.

3. ∞∞∞∞∞∞
Join Date
Aug 2008
Location
Posts
2,378
I live close to Nick, but I don't see how full each container is from the tablespace snapshot

4. ∞∞∞∞∞∞
Join Date
Aug 2008
Location
Posts
2,378
I meant it doesn't show number of used pages at the container level

5. :-)
Join Date
Jun 2003
Location
Posts
5,516

6. ∞∞∞∞∞∞
Join Date
Aug 2008
Location
Posts
2,378
I don't think there is an easy way to tell how full each container is. db2 only lists "Used pages" at the tablespace level, not at the container level. Since db2 accesses containers in a round-robin fashion (on extent basis), each container will generally have the same amount of used space - assuming that each of your containers is the same size (and it should be).

So, I'd go with used pages / # of containers

7. Registered User
Join Date
Nov 2007
Posts
14
Originally Posted by db2girl
I don't think there is an easy way to tell how full each container is. db2 only lists "Used pages" at the tablespace level, not at the container level. Since db2 accesses containers in a round-robin fashion (on extent basis), each container will generally have the same amount of used space - assuming that each of your containers is the same size (and it should be).

So, I'd go with used pages / # of containers
when you say
assuming that each of your containers is the same size (and it should be).
is that a best practice or is it forced upon you?
im not much of a DB2 guy, so this is all new to me.. we have an app that is running on DB2 7.2 (we are in the process of upgrading to v9 i believe) and im monitoring parts of the app, DB usage is part of that.

we tend to grow out as needed (no real DBA, the company handles it, and they go through DBA's like water)
so im monitoring the tablespaces to make sure they dont get filled (no auto grow) and then im monitoring the drives they are on (in case the vendor does something, and for trending)

so, i assume i was right with the container used info, so the question is, is either one of my guesses in the orginal post better than the other?

Thanks for the info.
Justin

8. ∞∞∞∞∞∞
Join Date
Aug 2008
Location
Posts
2,378
For performance reasons, containers should be the same size. Also, with SMS - tablespace is considered full when one of its containers is full so this is something to keep in mind if you're using SMS.

As far as container usage, I'd not worry about it too much... just monitor the tablespace usage.

9. ∞∞∞∞∞∞
Join Date
Aug 2008
Location
Posts
2,378
Originally Posted by jrich523
when you say

is that a best practice or is it forced upon you?

IBM DB2 9.5 Information Center for Linux, UNIX, and Windows

10. Registered User
Join Date
Nov 2007
Posts
14