vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi Group, It's really confusing to calculate the size of the DB2 UDB database in versions lesser than 8.2. In Version 8.2 if we run the query db2 "call get_dbsize_info(?,?,?,0)" it gives us an approximate size of the database. But it we try calculating the file system sizes of the database home directory, containers file system it gives some other size... it's so confusing which database size is accurate. Do we have stick to the size given by DB2 or size w.r.t the OS file systems. Where as in versions say like 8.1 0r Version 7, the above procedure is not working. So is there any other alternate method to calculate the size of the database? And for the group's information, I got a query which is also giving the size of the database, this I got while searching for my query in Google. the query is: db2 connect to <dbname> db2 "select (SUM(total_pages)*4)/(1024.0*1024) TOTAL_ALLOCATED_SPACE_IN_GB from table (snapshot_tbs_cfg('<dbname>',-1)) TBS_SPCE" db2 connect reset. Whether the above query is accurate in calculating the database size? Also I got a few doubt reg above query? what does this mean (SUM(total_pages)*4 think it works for tablespaces with default 4KB page size, what happens if the tablespaces are with different page sizes say some tablespaces in 4K and some tablespaces in 8/16/32K. So this case how should we calculate the size of the above database using the above query. If there is any other method to calculate the database size, pls kindly let me know. As the need is urgent, kindly let me know if you know the solution for my problem. Thanks in Advance. vj_dba |
| |||
| vijay.db@gmail.com wrote: > Hi Group, > > It's really confusing to calculate the size of the DB2 UDB database in > versions lesser than 8.2. > > In Version 8.2 if we run the query db2 "call get_dbsize_info(?,?,?,0)" > it gives us an approximate size of the database. > > But it we try calculating the file system sizes of the database home > directory, containers file system it gives some other size... > > it's so confusing which database size is accurate. Do we have stick to > the size given by DB2 or size w.r.t the OS file systems. > > Where as in versions say like 8.1 0r Version 7, the above procedure is > not working. So is there any other alternate method to calculate the > size of the database? > > And for the group's information, I got a query which is also giving > the size of the database, this I got while searching for my query in > Google. the query is: > > db2 connect to <dbname> > > db2 "select (SUM(total_pages)*4)/(1024.0*1024) > TOTAL_ALLOCATED_SPACE_IN_GB from table > (snapshot_tbs_cfg('<dbname>',-1)) TBS_SPCE" > > db2 connect reset. > > Whether the above query is accurate in calculating the database size? > > Also I got a few doubt reg above query? what does this mean > (SUM(total_pages)*4 > think it works for tablespaces with default 4KB page size, what > happens if the tablespaces are with different page sizes say some > tablespaces in 4K and some tablespaces in 8/16/32K. So this case how > should we calculate the size of the above database using the above > query. > > If there is any other method to calculate the database size, pls > kindly let me know. As the need is urgent, kindly let me know if you > know the solution for my problem. > > Thanks in Advance. > vj_dba > I have always used the size of a backup image to get a close approximation of "how big" a database is.... |
| |||
| vijay.db@gmail.com wrote: > Hi Group, > > It's really confusing to calculate the size of the DB2 UDB database in > versions lesser than 8.2. I've always felt that the easiest way is to get a snapshot for table spaces. Using the 'used pages' and 'page size' information for each tablespace will tell you how much space your database is using. It's trivial to write a script to calculate this for you. |
| |||
| On Apr 19, 11:14 pm, Ian <ianb...@mobileaudio.com> wrote: > vijay...@gmail.com wrote: > > Hi Group, > > > It's really confusing to calculate the size of the DB2 UDB database in > > versions lesser than 8.2. > > I've always felt that the easiest way is to get a snapshot for table > spaces. Using the 'used pages' and 'page size' information for each > tablespace will tell you how much space your database is using. It's > trivial to write a script to calculate this for you. I guess those only work for DMS, right? Looks like the page counts are zero on SMS. |
| ||||
| Ray wrote: > > I guess those only work for DMS, right? Looks like the page counts are > zero on SMS. > Not in my experience. SMS shows total number of pages == usable pages == used pages. And if you are far enough back level, you might actually need to execute the 'list tablespaces show detail' command. I don't remember when the tablespace snapshot was updated to show this information, but it was a while ago. |
| Thread Tools | |
| Display Modes | |
|
|