Firebird Documentation Index → Gfix - Database Housekeeping → Gfix Commands |
![]() |
![]() |
![]() ![]() ![]() ![]() |
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.
Firebird 2.5 onwards.
-FE[TCH_PASSWORD] <password file name> | stdin
| /dev/tty
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.
Firebird 2.5 onwards.
-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.
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.
To define the username and password as environment variables on a Linux system:
linux> export ISC_USER=sysdba linux> export ISC_PASSWORD=masterkey
Alternatively, on Windows:
C:\> set ISC_USER=sysdba C:\> set ISC_PASSWORD=masterkey
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.
-u[ser]
default user name
-pa[ssword]
default password
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:
linux> gfix -validate my_employee linux> Unable to perform operation. You must be either SYSDBA - or owner of the database
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.
However, passing the username and password works:
linux> gfix -validate my_employee -user sysdba -password masterkey
You will notice, hopefully, that some commands do not give any printed output at all. gfix, in the main, only reports when problems are encountered. Always check the response code returned by gfix to be sure that it worked. However, see the caveats section below for details because it looks like the response code is always zero - at least up until Firebird 2.0.
When logging into a database on a remote server, you will always
be required to pass the -u[ser]
and
-pa[ssword]
parameters.
![]() ![]() ![]() ![]() |
Firebird Documentation Index → Gfix - Database Housekeeping → Gfix Commands |