Subject Possible bug in RC8 -Finding out size of database through code from client
Author GOVINDKRISHNA
Hi List,

first let me explain what I am trying to do. I want to simplify administration. So I periodically want to check if the database file size is close 2GB in which case I want to automatically increase the number of files to two by doing a backup and restore.

A single file database size can be found out by multiplying Page Size in KB with No: of Pages.
But we couldn't find any algorithm that will return the database file size correctly for multi file databases.

We are retrieving Page Size and No: of Pages of the database using the interbase component TIBDatabaseInfo.
Our database configurations are -

SQL DIALECT 3
PAGE_SIZE = 8192 LENGTH = 1000000
DEFAULT CHARACTER SET NONE

See the Table Below for databases created with page size = 8192 and length = 1000 . Only the single file database gives correct result.

Noof DBFiles PageSize[Bytes] FileLength NooFPages ActualFileSizes CalculatedSize

1 8192 1000 131 1048 8 * 131 = 1048
2 8192 1000 1002 1056 & 16 8 * 1002= 8016
3 8192 1000 2002 1056,16 & 16
4 8192 1000 3002 1056,16,16 & 16

I am checking with 1.5 RC8.


Is this a bug.

Or is there any other way

TIA
gk



>>>This mail is created in Hamsa www.jlmatrix.com <<<