meta data for this page
  •  

Secondary Files Manager

The Secondary Files Manager can be found in the IBExpert Tools menu. Secondary files can be created for all Firebird and InterBase® databases. Although as each database file today in Firebird 2.1 can be up to 64 terabytes in size, this feature is only really applicable for old Firebird and InterBase® versions, unless you really have a huge amount of data - Firebird 2.1 allows you to create and manage up to 65,000 secondary files - enabling a total maximum database size of 128 petabyte!

First select the database for which the secondary files are to be created, from the pull-down list of connected databases.

Then simply click on the New File button (bottom left corner) to specify a secondary file. As a database file is being created here, it is important not to forget to also specify the drive and path, as well as the file name and suffix (usually .FDB or .GDB). Otherwise the file will be created and stored anywhere on the system (usually in the Windows System32 folder). Should this happen, the file drive and path can be viewed when the Secondary Files Manager is restarted.

After specifying the secondary file's name, either the starting page (File Start) or length in pages (File Length) can be specified by selecting the field, and clicking or using the space bar to activate the counter or allow numerical entry. Specifying both these parameters is unnecessary, and only provides an error source, as the starting pages of two files must of course concur with the number of pages of the first file.

When using the IBExpert Secondary Files Manager, the first secondary file starts at the current position in the primary file, i.e. the primary file is immediately considered to be “full”, and all new data and metadata from this point onwards is stored in this first secondary file. This can be viewed in the IBExpert Services menu item, Database Statistics. See below for the specification of the primary file size at the time of database creation. Of course, multiple secondary files may be specified here if wished. It is not necessary to specify the length of the last secondary file; this can therefore become as large as the physical disk space allows.

When all files have been specified satisfactorily, simply click the Apply button,

and check before finally committing or rolling back.

There are no performance advantages to be expected by distributing the database across several files, so it is not recommended that secondary files be used, unless the disk storage space and database size absolutely require it.

The secondary files' size, path and name can only be altered when the database is restored, as this is the only option which allows secondary files to be redefined.

For those preferring direct SQL input the syntax is as follows:

CREATE DATABASE "database name"
LENGTH <number > PAGES
FILE <secondary file 1> LENGTH <number> PAGES
FILE <secondary file 2> LENGTH <number> PAGES
...
FILE <secondary file N>;

The alternative syntax, using STARTING (AT PAGE), is as follows:

CREATE DATABASE "database name"
FILE <secondary file 1> STARTING AT PAGE <number>
FILE <secondary file 2> STARTING AT PAGE <number>
...
FILE <secondary file N> STARTING AT PAGE <number>;

The AT and PAGE keywords are optional. Firebird/InterBase® recognizes any of the following variations:

STARTING AT PAGE 5000
STARTING AT 5000
STARTING 5000

Please note that when a database is dropped/deleted, all secondary and shadow files are also deleted.