FirebirdSQL logo

-⁠Z

This is a modifier switch.Using -⁠z displays the version number of the gstat utility and of the Firebird installation.If you don’t supply a valid database name and possibly another switch, gstat will print out the gstat version and an error.If a valid database is provided, gstat will also print out version information about the database engine, and — if applicable — client library and protocol versions.

The shortest output would be from a -⁠t non_existent_tablename if all you need is the version details, as follows:

tux> gstat -t non_existing_tablename -z employee
gstat version LI-V2.1.3.18185 Firebird 2.1

Database "/opt/firebird/examples/empbuild/employee.fdb"
Database header page information:
...

Database file sequence:
File /opt/firebird/examples/empbuild/employee.fdb is the only file
        Firebird/linux Intel (access method), version
"LI-V2.1.3.18185 Firebird 2.1"
        Firebird/linux Intel (remote server), version
"LI-V2.1.3.18185 Firebird 2.1/tcp (greenbird)/P11"
        Firebird/linux Intel (remote interface), version
"LI-V2.1.3.18185 Firebird 2.1/tcp (greenbird)/P11"
        on disk structure version 11.1

Analyzing database pages ...
Note
The output above has been slightly changed to allow it to fit the page width for a pdf.

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

-⁠?

This switch displays the usage information of gstat.

Note
Introduced in Firebird 2.5.

-⁠D[ATA]

Specifying this switch causes gstat to analyse all user tables of the specified database.Indices are not analysed unless [gstat-cmdline-index] is also specified.

When combined with [gstat-cmdline-system], the system tables are analysed in addition to the user tables.

If [gstat-cmdline-table] is also specified, analysis is restricted to the specified tables.

This switch is implied by [gstat-cmdline-all].

-⁠E[NCRYPTION]

Displays statistics on how many database pages are encrypted.This can, for example, be used to track the progress of encrypting or decrypting a database.

For example, getting encryption statistics on a non-encrypted employee database:

C:\Program Files\Firebird\Firebird5.0>gstat -u sysdba -e employee

Database "C:\Program Files\Firebird\Firebird5.0\examples\empbuild\employee.fdb"
Gstat execution time Fri Feb 23 12:36:37 2024

Database header page information:
[..]

Data pages: total 122, encrypted 0, non-crypted 122
Index pages: total 99, encrypted 0, non-crypted 99
Blob pages: total 0, encrypted 0, non-crypted 0
Generator pages: total 1, encrypted 0, non-crypted 1
Gstat completion time Fri Feb 23 12:36:37 2024

And on an encrypted database:

C:\Program Files\Firebird\Firebird5.0>gstat -u sysdba -e crypttest

Database "C:\DB\encrypteddb.fdb"
Gstat execution time Fri Feb 23 12:37:55 2024

Database header page information:
[..]

Data pages: total 82, encrypted 82, non-crypted 0
Index pages: total 60, encrypted 60, non-crypted 0
Blob pages: total 0, encrypted 0, non-crypted 0
Generator pages: total 1, encrypted 1, non-crypted 0
Gstat completion time Fri Feb 23 12:37:55 2024

This switch cannot be combined with most other switches, specifically it will report an error when combined with [gstat-cmdline-all], [gstat-cmdline-data], [gstat-cmdline-header], [gstat-cmdline-index], [gstat-cmdline-record], [gstat-cmdline-system], or [gstat-cmdline-table].

Note
Introduced in Firebird 3.0.