FirebirdSQL logo

Backing up raw-device databases

Firebird databases need not be files;they can also be placed on a so-called raw device, for instance a disk partition without a file system.The question of where the delta has to be placed in such cases was at first overlooked during the development of nbackup.On Posix systems, if the database was located at e.g. /dev/hdb5, it could happen that the delta was created as /dev/hdb5.delta.In light of the nature and purpose of the /dev directory and its often limited available space, this is undesirable.

As of Firebird 2.1, nbackup refuses to operate on raw-device databases unless an explicit location for the delta file has been set.The way to do this is discussed in [nbackup-deltafile], later on in this manual.

Suppressing database triggers (Firebird 2.1+)

Firebird 2.1 introduced the concept of database triggers.Certain types of these triggers can fire upon making or breaking a database connection.As part of the backup process, nbackup opens a regular connection to the database (in some versions even more than once).To prevent database triggers from firing inadvertently, the -T or — since Firebird 3.0 — -NODBTRIGGERS switch can be used.

Direct I/O (Firebird 2.1.4+)

Originally, nbackup used direct I/O only when making a backup under Windows NT (and successors like 2000, 2003 etc).On all other OS’es, direct I/O was off.This caused problems on some Linux systems, so in versions 2.0.6 and 2.1.3 direct I/O was switched on under Linux as well.However, this turned out to be problematic for certain other Linux configurations.In 2.1.4 and 2.5 the original behaviour was restored, but this time as a default that was overridable by a newly added parameter: -D.Its use is as follows:

nbackup -B 0 cups.fdb cups.nbk -D on    -- direct I/O on
nbackup -B 0 mugs.fdb mugs.nbk -D off   -- direct I/O off

Just like the option letters themselves, the arguments ON and OFF are case-insensitive.

Direct I/O is only applied when making a backup, not during a restore.Under Windows it is realized by setting FILE_FLAG_NO_BUFFERING.On other systems, O_DIRECT and POSIX_FADV_NOREUSE are used.The latter two are sometimes unavailable;in such cases, they are (or one of them is) silently left out.Even if the user specified -D on explicitly, this doesn’t lead to a warning or error message.

Informational options (Firebird 2.5+)

Apart from the already mentioned -FE and -D parameters, Firebird 2.5 also saw the introduction of the following two:

-Z

Shows single-line version information.This option can be used independently, but also in combination with other parameters, such as -B, -R, -L etc.

-?

Shows a summary of nbackup’s usage and command-line parameters.Attention: If this option is present, all the other parameters are ignored!