Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2008
    Location
    Toronto, Canada
    Posts
    399

    Unanswered: db size and db capacity from get_dbsize_info proc

    I ran get_dbsize_info proc. Why db size is bigger than db capacity?

    db2 "call get_dbsize_info(?,?,?,0)"

    Value of output parameters
    --------------------------
    Parameter Name : SNAPSHOTTIMESTAMP
    Parameter Value : 2009-03-12-14.46.47.710674

    Parameter Name : DATABASESIZE
    Parameter Value : 845115392

    Parameter Name : DATABASECAPACITY
    Parameter Value : 33538042

    Return Status = 0

    Thanks
    DB2 9.5/9.7 on Unix/AIX 6.1/Linux

  2. #2
    Join Date
    Jan 2003
    Posts
    1,605
    Hi,
    I have tried above command on DB2 v9.5 fp2a and it works fine.
    It looks like bug in your sample. What is your version of DB2 and fixpack level? Try installing fixpack or report PMR to IBM support.
    Regards

  3. #3
    Join Date
    Dec 2008
    Location
    Toronto, Canada
    Posts
    399
    Quote Originally Posted by grofaty
    Hi,
    I have tried above command on DB2 v9.5 fp2a and it works fine.
    It looks like bug in your sample. What is your version of DB2 and fixpack level? Try installing fixpack or report PMR to IBM support.
    Regards
    The example above was from "DB2 v9.5.0.3", "s08121", "U823474", and Fix Pack "3a" (just installed recently). Now I tried it on "DB2 v8.1.1.144", "s080111", "U811269", and FixPak "16" and got more sensible result:

    devdb2[/home/dba1]db2 "call get_dbsize_info(?,?,?,0)"
    Value of output parameters
    --------------------------
    Parameter Name : SNAPSHOTTIMESTAMP
    Parameter Value : 2009-03-13-08.38.48.864774
    Parameter Name : DATABASESIZE
    Parameter Value : 6016061440
    Parameter Name : DATABASECAPACITY
    Parameter Value : 95634335232
    Return Status = 0


    Do you really think there is a bug in our DB2 v9 and we need to report it? Thanks
    DB2 9.5/9.7 on Unix/AIX 6.1/Linux

  4. #4
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367
    I'm getting a similar output (DATABASESIZE > DATABASECAPACITY) with v9.5 fp2. I think it has to do with the fact what most of my default tablespaces are SMS. I created the db with the "automatic storage no" option and therefore most of them are SMS.

    From the v9.5 manual:

    dbsize
    An output parameter of type BIGINT that returns the size of the database (in bytes). The database size is calculated as follows: dbsize = sum (used_pages * page_size) for each table space (SMS & DMS).

    dbcapacity
    An output parameter of type BIGINT that returns the database capacity (in bytes). This value is not available on partitioned database systems. The database capacity is calculated as follows: dbcapacity = SUM (DMS usable_pages * page size) + SUM (SMS container size + file system free size per container). If multiple SMS containers are defined on the same file system, the file system free size is included only once in the calculation of capacity.


    Check what type of tablespaces this db has and how much free space the filesystem(s) have. I think the number is wrong in my case.

  5. #5
    Join Date
    Dec 2008
    Location
    Toronto, Canada
    Posts
    399
    I even get -7 for one of the databases on v9.5:

    devdb2[/home/dba1]db2 "call get_dbsize_info(?,?,?,0)"

    Value of output parameters
    --------------------------
    Parameter Name : SNAPSHOTTIMESTAMP
    Parameter Value : 2009-03-13-09.19.09.320917
    Parameter Name : DATABASESIZE
    Parameter Value : 636674048
    Parameter Name : DATABASECAPACITY
    Parameter Value : -7
    Return Status = 0
    DB2 9.5/9.7 on Unix/AIX 6.1/Linux

  6. #6
    Join Date
    Nov 2007
    Posts
    72
    i think you consider this option of doing runstats and then running this stored procedure ..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •