FDB File Documentation


Summary

An .fdb file is most often a Firebird Database: a single file that holds an entire SQL relational database, including its tables, indexes, views, stored procedures, triggers and the data. You do not open it like a document. You connect to it with a Firebird client such as FlameRobin, DBeaver or IBExpert once the Firebird engine is installed, then query it with SQL. Its generic MIME type is application/octet-stream.

Technical details

FeatureValue
Full nameFirebird Database
File extension.fdb
MIME typeapplication/octet-stream
Format typeSingle-file SQL relational database, paged binary
CategoryDatabase files
DeveloperFirebird Project (forked from Borland InterBase)
IntroducedFirebird forked from InterBase when it was open-sourced in 2000; the InterBase .gdb/.fdb lineage dates to the 1980s
On-disk structureODS (On-Disk Structure) — versioned
Page-basedYes — fixed-size pages
Magic numberNone — no friendly ASCII magic; identified by the Firebird tools. The header page records the ODS version and page size
Open standardYes — open source
Predecessor extension.gdb
Related extensions.gdb .ib .fbk
Other meaningsVisual FoxPro database; Extensis Portfolio catalog
Specificationfirebirdsql.org
Structure at a glance

A Firebird .fdb is a paged binary file. The first page is the database header page, which records the ODS (On-Disk Structure) version and the page size, commonly 4096, 8192 or 16384 bytes. The rest of the file is data pages, index (B-tree) pages, and system-table (metadata) pages. There is no distinctive ASCII signature at the start of the file. It is identified by opening it with a Firebird tool that reads the header page, not by matching a header magic string.

What is an FDB file?

An .fdb file is most often a Firebird database. Firebird is a mature, open-source SQL relational database that forked from Borland InterBase when Borland released the InterBase source code in 2000. A single .fdb file holds an entire database: the tables, the indexes, the views, the stored procedures, the triggers, and the data itself, all in one operating-system file. That single-file design is why Firebird is common in embedded use and in desktop and business applications that want to ship a working database as one file rather than as a directory of pieces.

The extension is somewhat generic. The site name for it is simply “Database file”, and a few unrelated programs have used .fdb over the years. But in practice most .fdb files you meet are Firebird databases, so that is what this page describes. The secondary meanings (a Visual FoxPro database and an Extensis Portfolio catalog) are covered near the end.

Firebird and the InterBase lineage

Firebird did not start from scratch. Its ancestor, InterBase, began in the mid-1980s and became a Borland product. In July 2000 Borland open-sourced InterBase 6, and an independent project forked that code and named it Firebird. Both engines share the same basic on-disk design, which is why older InterBase databases and Firebird databases look so similar internally. The older files used the .gdb extension; Firebird settled on .fdb. See the companion page on .gdb for the InterBase side of the family.

Firebird is a server engine. There is a full server that runs as a service and accepts connections, and there is an embedded mode where the engine is loaded directly into an application. In both cases the .fdb is the database, and the engine is the program that reads and writes it. You do not run the file; you run the engine, and the engine opens the file.

The paged on-disk structure and ODS versioning

Internally a Firebird database is a sequence of fixed-size pages. The page size is chosen when the database is created, commonly 4096, 8192 or 16384 bytes, and all reads and writes happen a whole page at a time. There is no friendly ASCII magic number at the start of the file, so you cannot recognise a Firebird database the way you recognise a ZIP or a PDF by its first few bytes.

The first page is the header page. It records the page size, the database metadata, and the ODS version. ODS stands for On-Disk Structure, and it is an integer that stamps which layout revision the file uses. After the header come the other page types:

Header page    ODS version, page size, database metadata
Data pages     table rows, packed into fixed-size pages
Index pages    B-tree indexes over table columns
System tables  metadata: definitions of tables, columns, procedures, triggers, views

The system tables are worth noting: a Firebird database describes itself. The definitions of every table, column, stored procedure, trigger and view live inside the database as ordinary system tables, which is part of why the whole thing travels as one file.

Why an FDB can fail to open on another machine (ODS mismatch)

The ODS version is not just trivia. It is the single most common reason a Firebird database refuses to open after you move it. Because the on-disk structure is versioned, a database created by a newer Firebird server may not open in an older server. The newer server writes a newer ODS, and the older engine does not understand that layout, so it declines to attach the file.

This bites people who copy an .fdb from one machine to another and find that the target has an older Firebird installed. The fix is usually to match or upgrade the Firebird version on the target machine, or to move the data with a proper backup and restore (Firebird’s gbak tool and its .fbk backup files) rather than copying the raw database file. When you plan a move, check the Firebird versions on both ends first. When you inspect an unfamiliar .fdb, work on a copy, since ODS sensitivity means a failed in-place operation is harder to undo.

Connecting to an FDB: FlameRobin, DBeaver, IBExpert and isql

You connect to a Firebird database; you do not double-click it. A connection needs the Firebird engine running (or embedded), a path to the .fdb file, and a user and password. The default administrative account is SYSDBA. Free tools that speak Firebird include FlameRobin (a lightweight GUI), DBeaver Community (cross-platform, works with many databases), and IBExpert (freemium). Firebird also bundles a command-line client called isql.

A minimal isql session against a local database looks like this:

isql -user SYSDBA -password masterkey /path/to/database.fdb
SQL> SELECT COUNT(*) FROM CUSTOMERS;
SQL> SHOW TABLES;
SQL> QUIT;

On a server connection you give a host and the file path, for example localhost:/path/to/database.fdb; in embedded mode the path alone is enough. One honest caution belongs here: default Firebird installations historically shipped with the well-known SYSDBA / masterkey credentials, and databases can hold sensitive business data, so leaving those defaults in place is a real weakness. Change them.

Exporting is the other common task. There is no single-file “fdb-to-csv” conversion, because a database is many tables rather than one document. Instead you export per table: DBeaver, FlameRobin and IBExpert can dump a table to .csv or to a spreadsheet, or dump the schema and data as SQL. Migrating to Microsoft Access (an .mdb) moves the data and structure but not the stored procedures and triggers, which have no equivalent there. A database has no single page to render as a PDF.

From .gdb to .fdb: the rename

Early Firebird and InterBase databases used the .gdb extension. The switch to .fdb was not a format change; the file layout stayed the same. The reason was practical: on Windows XP, System Restore watched files with the .gdb extension and would try to snapshot them, which interfered with live databases. Renaming the default extension to .fdb stopped System Restore from grabbing the files. So a .gdb and a .fdb from the same era are the same kind of file with different names, and the difference between them is history rather than structure.

Other formats that use .fdb

Because the extension is generic, a couple of other programs have used .fdb. A Visual FoxPro database is a legacy Microsoft format; FoxPro itself was discontinued in 2007, so these files are old. An Extensis Portfolio catalog is a digital-asset-management catalog: it stores thumbnails and metadata about a collection of media rather than the media themselves. If your .fdb came out of one of those programs, it is not a Firebird database and Firebird tools will not open it. When in doubt, note which application produced the file.

FAQ

Why can’t I open my FDB after upgrading or downgrading Firebird? The on-disk structure is versioned (ODS). A database written by a newer server uses a newer ODS that an older server does not understand, so it will not attach. Match the Firebird version, or move the data with a backup and restore rather than copying the raw file.

What is the difference between .fdb and .gdb? Almost none at the format level. Both are the same InterBase/Firebird single-file database design. The extension changed to .fdb to keep Windows XP System Restore from interfering with .gdb files.

How do I export a Firebird database to CSV or Excel? Export per table using DBeaver, FlameRobin or IBExpert. There is no one-shot whole-database converter, because a database is a set of tables rather than a single document. Avoid sketchy “FDB viewer” downloads that bundle unwanted software; use the official Firebird tools instead. The Firebird project site is at firebirdsql.org.

References