System objects RDB$, MON$, IBE$

Firebird/InterBase® and IBExpert generate system database objects, and store their own specific system information about the database objects in system tables. System objects are displayed in the DB Explorer in red, if the system options have been flagged in the Register Database dialog (called using the right mouse button Additional/DB Explorer).

Firebird and InterBase® system objects contain the prefix RDB$ and Firebird monitoring tables contain the prefix MON$; IBExpert system objects contain the prefix IBE$.

A newly created database is almost 0,5 MB large. This is due to the system tables that are automatically generated by Firebird/InterBase® when a database is created.

new:

These system tables contain a wealth of information, which IBExpert uses in many of its functionalities. Although you may consult and study the information in these system objects, please do not manipulate any data contained in them, as it will almost certainly result in a corrupt database!

back to top of page

RDB$ system objects

These are the Firebird and InterBase® objects. All field names in these tables are also prefixed RDB$ for identification. They include the following:

System tables relating to the database

The dependent element is stored in RDB$DEPENDENT_NAME and the element upon which the other element is dependent is displayed in the RDB$DEPENDED_ON_NAME. If the dependency is on a column, then this is named in RDB$FIELD_NAME.

back to top of page

System tables relating to tables and views

* RDB$INDICES: here you can view the index names (RDB$INDEX_NAME) and the table names (RDB$RELATION_NAME). Those indices belonging to a specific table are numbered sequentially, beginning with the number 1 (displayed in RDB$INDEX_ID). Unique indices are displayed in RDB$UNIQUE_FLAG with the flag 1, RDB$INDEX_TYPE shows whether the index is ascending (0) or descending (1) and RDB$INDEX_INACTIVE displays inactive indices with the value 1. The index selectivity is stored in the RDB$STATISTICS column.

back to top of page

System tables relating to domains

System tables relating to procedures and triggers

back to top of page

System tables relating to user rights

Other system tables

* RDB$GENERATORS: this table stores the generator name and a unique number. The generator value is not stored in this system table.

See also:

back to top of page

MON$ system tables

Firebird monitoring tables were introduced in Firebird 2.1. and enable run-time database snapshot monitoring (of transactions, tables, etc.) via SQL over some new virtualized system tables.

By querying these system tables you get a snapshot of the current activities in the database. For example, MON$DATABASE provides a lot of the database header information that could not be obtained previously via SQL: such details as the on-disk structure (ODS) version, SQL dialect, sweep interval, OIT and OAT and so on.

You can view other activites, such as who is connected to your database, which transactions and statements are running and so on. You even can cancel a running query by executing a DELETE statement on MON$STATEMENTS.

When querying the monitor tables it's important to remember that it's just a snapshot.

The Firebird MON$ system tables include the following in Firebird version 2.1:

Further details can be found in the Firebird 2.1 Release Notes chapter, Administrative features, and in the Firebird 2.5 Release Notes.

The following improvements have been incorporated in Firebird 2.5:

For example: to cancel all current activity for a specified connection:
DELETE FROM MON$STATEMENTS
WHERE MON$ATTACHMENT_ID = 32
To disconnect all clients except the “ME” connection:
DELETE FROM MON$ATTACHMENTS
WHERE MON$ATTACHMENT_ID <> CURRENT_CONNECTION

See also:

back to top of page

IBE$ system objects

IBExpert creates its own system objects to support features such as logging and version history:

These objects should not be manipulated in any way, otherwise certain IBExpert functionalities will be detrimentally affected.

IBE$VERSION_HISTORY system table

A special browser is implemented for the IBE$VERSION_HISTORY table. When IBE$VERSION_HISTORY is opened in the Table Editor, a new Version Browser page is automatically opened:

Select the database object and the versions you wish to compare. Text and code is highlighted according to whether it has been added, modified or deleted.

If the IBE$VERSION_HISTORY table already exists in your database you should add the following changes manually if you need to log the client address and the RDB$GET_CONTEXT function is available:

New column in the IBE$VERSION_HISTORY table:

   ALTER TABLE IBE$VERSION_HISTORY ADD IBE$VH_CLIENT_ADDRESS VARCHAR(32) CHARACTER 
   SET NONE;

Additional line of code in IBE$VERSION_HISTORY_BI trigger:

   NEW.IBE$VH_CLIENT_ADDRESS = RDB$GET_CONTEXT('SYSTEM', 'CLIENT_ADDRESS');

See also:

Verson History

IBE$DBINSIDE$ERRORS system table

This table is automatically created by IBExpert, when you use the Extract data/metadata on a corrupt database in Database Inside.