Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2002
    Location
    Hamilton
    Posts
    150

    Unanswered: size of database

    Does anyone have a simple way of determining the size of the database?

    thanks

    mark

  2. #2
    Join Date
    Apr 2003
    Posts
    3
    Here is the method I have for estimating SMS tables on AIX

    1.) Get the space allocate to tables by using the following query:
    select sum((FPAGES * pgsize) / (1024 * 1024)) as SPACE_MB from syscat.tables
    pgsize is the page size e.g. 4k=4096, 8k=8192, etc.

    2.) Get the space allocated to indexes using the following query:
    select sum((FULLKEYCARD * ((COLCOUNT * avgcollength) + 8)) / (1024 * 1024)) as SPACE_MB from syscat.indexes
    avgcollength is the average length of all columns in all indexes (fun, fun).

    3.) Get the space used by the database logs by calculating:
    (4096 * pgsperlog * (primary + secondary)/ 1024 * 1024
    pgsperlog is the number of 4K pages in a log
    primary is the number of primary logs
    seconday is the number of secondary logs

    4.) Add the results of steps 1-3 to get the approximate total MB (i.e. 1024 * 1024).

    The real variable in this is the calculation of index size because of the need to know the average length of all columns in all indexes. There are too many columns in too many indexes in our databases to get an actual average. Fortunately, most of the columns in our indexes are integers so I just used "4".

    Of course there is additional space used by backups. For a full backup I count that as another copy of the active database. Incremental backups depend on how much of the database is updated daily...10%, 25%, etc.

    This is not a perfect method but it seems to get me pretty close. Anyone else have a better method? Questions? Comments?

Posting Permissions

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