472,798 Members | 1,449 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

How to collect DB2 Database size Version Lesser than 8.2

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

Apr 18 '07 #1
4 8144
m
vi******@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....

Apr 18 '07 #2
Ian
vi******@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.

Apr 20 '07 #3
Ray
On Apr 19, 11:14 pm, Ian <ianb...@mobileaudio.comwrote:
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.

Apr 20 '07 #4
Ian
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.

Apr 20 '07 #5

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

Similar topics

5
by: Sharif T. Karim | last post by:
How would I get the total size of a mysql database in MB format? -- Sharif T. Karim ....you don't know wrath yet...
1
by: Robin Tucker | last post by:
As I had real problems working my head around sp_spaceused, I've written an SP to do it (I also noted a lot of questions about this when "searching"). Pass in a database name and it will return the...
19
by: dchow | last post by:
Our database size is currently 4G and is incrementing at a rate of 45M/day. What is the max size of a SQL database? And what is the size beyond which the server performance will start to go down?
2
by: Sue | last post by:
I have a large database currently using up 30GB of space -- problem is, I am running out of space on my harddrive and so have to do some cleanup. One of the tables has a blob field and I find that...
5
by: Campano, Troy | last post by:
Is there a way to limit the size that an individual database can take up? My understanding is that all your databases go into a file system which is your 'catalog cluster'. But all the...
2
by: Laurence | last post by:
Hi folks, My database DB03 is circular logging. I called the db2 procedure: get_dbsize_info to get the database size as below: Parameter Name : SNAPSHOTTIMESTAMP Parameter Value :...
5
by: aleu | last post by:
Hi all, Could you please advise whether there are documents describing impact of MS SQL server 2005 database size on its performance? I have essentially two things in mind when writing the...
3
by: ramprat | last post by:
Hi Everyone, I don't know if this is a problem but I have a database I have been building and currently there are 10 or less tables in it with 100 or less records in each. In many cases there are...
1
by: rednemesis | last post by:
Good Day everyone! When I calculated the size of the database on my system using the formula: Total Page size x Page size (4096) = Total Database Size Used page size x Page size (4096) =...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

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.