Howto Fix Firebird Corruption
Howto Fix Firebird Corruption
Howto Fix Firebird Corruption
Otherwise, if you do have the Firebird Server 1.5 installed and running (or
Firebird 2 if using AyaNova 4):
1. First, run a gfix against the database to confirm it shows errors (similar to
below, but enter your own path and your own user and password for Firebird)
If there are not errors, than you know the database is not corrupted.
3. Then perform a restore of the database. (refer to the AyaNova v3 Manual section
"Restore the database with a network Firebird server" page 590 or the AyaNova 4
Help section if using AyaNova 4)
4. Now run the gfix as outlined above again. If errors no longer show, than the
database corruption has been fixed. If errors continue to show, backup and restore
again. If errors continue to show, than the database is not recoverable and you
will need to restore from your backup from before the corruption occurred.
Note
In the following discussion, I use the full parameter names in all examples. This
is not necessary as each command can be abbreviated. When the command is shown with
'[' and ']' in the name then these are the optional characters.
For example, the command -validate is shown as -v[alidate] and so can be specified
as -v, -va, -val and so on up to the full -validate version.
For almost all of the options in the following sections, two of the above command
line options will be required. These are -u[ser] and -pa[ssword]. These can be
supplied for every command as parameters on the command line, or can be configured
once in a pair of environment variables.
-?
This switch displays the command line options and switches. It replaces the old
method in which you had to supply an invalid switch (such as -help) in order to see
the list of valid ones.
Note
This switch causes the password for the appropriate user to be read from a file as
opposed to being specified on the command line. The file name supplied is not in
quotes and must be readable by the user running gfix. If the file name is specified
as stdin, then the user will be prompted for a password. On POSIX systems, the file
name /dev/tty will also result in a prompt for the password.
Note
-u[ser] username
Allows the username of the SYSDBA user, or the owner of the database to be
specified This need not be supplied if the ISC_USER environment variable has been
defined and has the correct value.
-pa[ssword] password
Supplies the password for the username specified above. This need not be supplied
if the ISC_PASSWORD environment variable has been defined and have the correct
value.
Note
Up until Firebird 2, any utility which was executed with a password on the command
line could result in other users of the server seeing that password using a command
like ps -efx | grep -i pass. From Firebird 2 onwards, this is no longer the case as
the password on the command line can no longer be seen by the ps (or other)
commands.
This is very insecure as it allows anyone who can access your session the ability
to perform DBA functions that you might not want to allow.
If you have not defined the above environment variables, some commands will not
work unless you supply -u[ser] and -pa[ssword] on the command line. For example:
The line that starts with 'Unable to perform' above, has had to be split to fit on
the page of the PDF file. In reality, it is a single line.
Note
When logging into a database on a remote server, you will always be required to
pass the -u[ser] and -pa[ssword] parameters.