FB TraceManager 3 - Documentation

Database Monitoring - Monitoring (MON$) Tables

Database Monitoring - Monitoring (MON$) Tables

Previous topic Next topic  

Database Monitoring - Monitoring (MON$) Tables

Previous topic Next topic  

The Monitoring (MON$) Tables integration in FB TraceManager 3 is another tool to monitor your database. While monitoring a Firebird database with the Audit and Trace Services API is a continuous process, the monitoring tables in Firebird give you a snapshot of the current activities and the state of your database. Adding a user-friendly layer in FB TraceManager 3 on top of the various MON$ tables is a great addition. It is beyond the scope of this product documentation to discuss the Firebird monitoring tables in general and in full detail. Please refer to the Firebird 2.1 and Firebird 2.5 release notes. All Firebird 2.1 / 2.5 monitoring tables are fully supported in FB TraceManager 3.


New in V3.5: Firebird 3 support has been added.



Supported MON$ Tables


The following table gives you a list of the supported MON$ tables and their integration in FB TraceManager:


MON$ Table





Information about the connected database, similar what you can find by querying the header page.



Information about the currently connected/attached clients. Here you can also cancel entire attachments.



Information about all active/idle transactions.



Information about all active/idle/stalled statements. Here you can also cancel active statements.


I/O Statistics

I/O statistics on the number of reads/writes from/to disk and fetches/marks from/to the cache on different granularity levels. FB TraceManager adds an additional derived attribute into the grid output called Cached Hit Ratio [%], which is a measure on how frequently the page cache is visited compared to disk reads. Higher is better.


Record Statistics

Record-level statistics like the number of non-indexed/indexed reads, deletes, inserts, updates and garbage collection counters (backouts, purges, expunges) on different granularity levels. FB TraceManager adds additional derived attributes into the grid output called Seq Reads Ratio [%], Idx Reads Ratio [%] and Has Garbage Collection.


Memory Usage

Memory usage on different granularity levels. While the base values in the monitoring tables are in bytes, FB TraceManager adds additional columns calculating KB and MB. Not used for ODS 11.1 (Firebird 2.1) databases.


PSQL Call Stack

Information on the currently running PSQL code modules (stored procedures, triggers).


Context Variables

Information on the currently used context variables set by the RDB$SET_CONTEXT function. Not used for ODS 11.1 (Firebird 2.1) databases.


Table Statistics

I/O and record statistics for currently "active" tables. Introduced for ODS 12.0 (Firebird 3) databases.



User Interface


The data grids support the usual operations like filtering, sorting and aggregated values in the grid footer. The following screen shows the user interface of the monitoring table integration. In particular the currently attached clients, with the count aggregate function applied in the footer area, which tells us the number of attachments.




You can cancel selected attachments by clicking the Cancel Attachment button.


Hint: It's worth to be mentioned that FB TraceManager queries the monitoring tables in way that monitoring output does not include any data from the FB TraceManager monitoring table query request. What you see is pure data from all other activities.



Context-sensitive Filtering


Beside regular expression filters, FB TraceManager supports something called Context-sensitive Filtering. The monitoring tables implicitly have various 1:n relationships included. For example on attachment can have several transactions and/or statements. Several statements can run in context of one transaction etc. Due to the various granularity levels in the I/O and record statistics, the MON$STAT_ID field is used in different tables as well.


Context-sensitive Filtering helps you to resolve this dependencies. For example: If you are in the Attachments tab, inspecting the currently attached clients, simply select a record, right-click to open the context-menu, choose Set Filter | Attachment ID | Filter Transactions, then the grid in the Transactions tab is filtered by the currently selected Attachment ID. This is context-sensitive in a way, that FB TraceManager provides you with the appropriate filtering options per MON$ table. Simply watch out the various sub-menus in the Set Filter area of the grid context-menu.



Enumeration translation


There are various places in the monitoring tables, which uses some kind of numerical values representing some kind of enumeration type. Good examples are:




They all are mapped to more meaningful data in additional grid columns, for example State Text = 'Idle', if MON$STATE = 0.



Taking Snapshots


FB TraceManager supports taking snapshots to persist the currently fetched monitoring tables content into the FBTM3.fdb database for later inspection. This can be done with the Take Snapshot All button, if you wish to do that for all tables or more selectively in the various tabs.


Hint: Taking a full snapshot can be done automatically, if you enable the Log to database option. If this option is on, each Refresh All request issues storing a full snapshot automatically.



Customization and Settings


Like the Header Page Monitoring module, the monitoring tables integration is highly customizable as well. Simply click the Settings flyout tool panel to get in touch with various options.




The various settings are again more or less self-explanatory. Use the Paused and Refresh interval option to re-query the monitoring tables with the given rate automatically. If the Log to database option is on, a full snapshot is taken after refreshing all tables.


A customizable color management facility helps you to spot various conditions in the monitoring tables output more easily.


Changed settings are stored and re-loaded every time you open the database monitoring area when connecting to a database.



See also

Register Project

Database Monitoring

Database Monitoring - Header Page Monitoring

Database Monitoring - Database Statistics Monitoring