InterBase 7 for Linux Database File Size Limitation

By: Quinn Wildman

Abstract: 12/17/02 To prevent corruption you should limit your database size to 4 GB

Users have identified a file size limitation for InterBase 7 on Linux that, when encountered, can cause database corruption. This problem exists with InterBase 7.0 on Linux only. Borland has confirmed this problem and a patch is now available for download from http://www.borland.com/products/downloads/download_interbase.html

The problem can occur when a database file size grows to exceed 4 GB. Any operation which might cause the database size to grow is suspect, such as inserting data or creating meta data.

Without the patch, the work-around to the problem is to limit the size of your database to 4 GB.

For existing databases, backup and restore your database to a new, multi file database that creates secondary files, with the primary database file and all secondary files being less than or equal to 4 GB in size.

Example:

gbak olddatabase.ib backup.gbak
gbak -c backup.gbak newdatabase1.ib 1048576 newdatabase2.ib 1048576 newdatabase3.ib

This backs up a database called olddatabase.ib and then creates a new database called newdatabase1.ib with 2 secondary files named newdatbase2.ib and newdatabase3.ib where the first seconary file limited to 4 GB and the second is of unlimited size. The size of the final secondary file cannot be limited. Make sure that you call for enough secondary files that are limited to 4GB to take care of your anticipated total database file size.

For new databases use a similar strategy.

Example:

create database 'newdatabase1.ib' page_size 4096 length 1048576 file 'newdatabase2.ib' length 1048576 file 'newdatabase3.ib'

Like the example for existing databases, this creates a primary database file named newdatabase1.ib which is limited to 4 GB is size, and 2 secondary files where the first secondary file is limited to 4 GB and the second is of unlimited size. The size of the final secondary file cannot be limited. Make sure that you call for enough secondary files that are limited to 4GB to take care of your anticipated total database file size.

Note that the number 1048576 is used in the above examples based on the following calculation: 32^2/4096, or put another way, 4 GB/4K. 4K is used here because it is the page size for the database.

For additional information on creating multifile databases see chapter 3 of the Interbase Data Definition Guide manual.

Borland has given this issue top priority. Borland is currently preparing a patch which will be available as soon as QA certification is completed. We will have the patch available at http://www.borland.com/products/downloads/download_interbase.html when available and announce the fix on the Borland Developer Network and in the Borland InterBase general newsgroup.

Server Response from: ETNASC04