Domanda

I have a firebird database that is edging the 4GB filesystem limit size. How do I split a single database file into multiple files?

È stato utile?

Soluzione

Firebird databases can span upto several terabytes for a single file database. A limit of 4GB is mentioned in the InterBase 6.0 manual, but that limit only applies to filesystems which do not support larger files. As far as I know almost all filesystems support larger files than that (a notable exception is of course FAT(32)). See also Firebird Database Limits.

If you do need to split your files, you need to add secondary files. There are two ways to go about this:

1) Use ALTER DATABASE to add additional files:

ALTER DATABASE ADD FILE '<path-to-file>' LENGTH <number> PAGES 
   STARTING AT PAGE <number>

Be aware that specifying a STARTING AT PAGE number which has already been created will simply create the file when the next page is allocated. So it will not start at the specified page, but it will start at <current page count> + 1. See also page 22 in the InterBase 6.0 Language Reference (available from http://www.firebirdsql.org/en/reference-manuals/ ) or page 238 - 240 of The Firebird Book by Helen Borrie.

2) (if you need to split an existing database): backup the database and restore it while specifying multiple files and the size of each file:

gbak -C <backupfile> <file1> <maxsize of file1> 
    <file2> <maxsize of file2> .... <fileN>

For the last file you don't specify a size, it will grow until it hits a filesystem limit (if any), in that case you will need to add additional secondary files as described above. See also page 162 of the Interbase 6.0 Operations Guide (also available from http://www.firebirdsql.org/en/reference-manuals/ ) or page 825 - 827 of The Firebird Book.

But as I said: on almost any (modern) filesystem the 4 GB limit does not apply.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top