Command-line Switches
Gstat should be run as either root or the Firebird user.This is because the default operating system permissions when a new database is created, are such that only the owner — firebird — has access to the database file(s).Even members of the firebird group have no read access by default.
Gstat
is normally called as follows:
gstat database_name [switches]
The usage instructions shows that gstat
can also be called as follows:
gstat [switches] database_name
In practice, switches can occur both before and after the database name.However, the [gstat-cmdline-table] switch can only be used with multiple table names if it is placed after the database name.
The database name cannot be a remote database, it must be local, but it can be an alias for a local database.The reason that it must be local is that obtaining the header information of gstat
is done at the physical file level as opposed to making a database connection to the server — it reads the database file directly.Depending on the Firebird version and OS platform, other operations may connect to the local server or use the embedded engine to gather information.
If gstat
is called with an invalid switch, or with [gstat-cmdline-help], the following is displayed to remind you of the valid switches.Only the short form of the switches is displayed.
./gstat -? usage: gstat [options] <database> or gstat <database> [options] Available switches: -a analyze data and index pages -d analyze data pages -e analyze database encryption -h analyze header page ONLY -i analyze index leaf pages -s analyze system relations in addition to user tables -u username -p password -fetch fetch password from file -r analyze average record and version length -t tablename <tablename2...> (case sensitive) -role SQL role name -tr use trusted authentication -z display version number option -t accepts several table names only if used after <database>
Note
|
The links are not present in the actual Firebird 1.0 and 1.5 also had a |
The gstat
usage instruction only displays abbreviated forms of switches.In the following sections, we will show the full switch names, with the optional part in square brackets (‘[
’ and ‘]
’).For example, for [gstat-cmdline-all], this means that you can enter -A
, -AL
and -ALL
.Switch names are case-insensitive.