Firebird Documentation IndexGstat - Firebird Database Statistics Reporting Tool → Command-line Switches
Firebird Home Firebird Home Prev: Gstat - Firebird Database Statistics Reporting ToolFirebird Documentation IndexUp: Gstat - Firebird Database Statistics Reporting ToolNext: Gstat Examples And Interpretation

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]

Some documentation advises that gstat can be called as follows:

gstat [switches] database_name

However, although it does work this way, problems arise when the -t[able] switch is used.

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 because gstat works at the physical file level as opposed to making a database connection to the server - it reads the database file directly.

If gstat is called with an invalid switch, or with the new -? switch from Firebird 2.5 onwards, the following is displayed to remind you of the valid ones. Only the short form of the switches is displayed, unfortunately.

 ./gstat -?
usage:   gstat [options] <database> or gstat <database> [options]
Available switches:
    -a      analyze data and index pages
    -d      analyze data pages
    -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)
    -z      display version number
option -t accepts several table names only if used after <database>

Note

In Firebird versions prior to 2.0, the -l[og] switch could also be used. This reported on the details of the logging page(s) within the database. The logging pages have not been used for some time and the switch has now been removed from gstat.

Note

The -fetch switch is only available from Firebird 2.5 onwards.

These switches are described below.

The output starts by displaying the gstat version, followed by the details of the database header. The database file & Firebird details are displayed next and finally, the details for the supplied table name, which of course is not found.

Prev: Gstat - Firebird Database Statistics Reporting ToolFirebird Documentation IndexUp: Gstat - Firebird Database Statistics Reporting ToolNext: Gstat Examples And Interpretation
Firebird Documentation IndexGstat - Firebird Database Statistics Reporting Tool → Command-line Switches