<?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'> <html class="client-nojs" dir="ltr" lang="en"> <head> <meta charset="UTF-8" /> <title>Modules/FireBird - OpenSCADAWiki</title> <meta content="MediaWiki 1.26.4" name="generator" /> <link href="https://www.gnu.org/copyleft/fdl.html" rel="copyright" /> <link href="../files/doc.css" rel="stylesheet" /></head> <body><div class="floatright"><a href="../index.html"><img alt="OpenSCADA" src="../../en/files/index.png" /></a></div><div id="mw_header"> <div class="mw-indicators"> </div> <h1 id="firstHeading" lang="en">Modules/FireBird</h1> </div><div class="mw-content-ltr" dir="ltr" id="mw-content-text" lang="en"><div class="mw-pt-languages" dir="ltr" lang="en"><div class="mw-pt-languages-list autonym"><span class="mw-pt-languages-ui mw-pt-languages-selected mw-pt-progress mw-pt-progress--complete">English</span> • ‎<a class="mw-pt-progress mw-pt-progress--complete" href="../../ru/Modules/FireBird.html" title="Модули/FireBird (100% translated)">mRussian</a> • ‎<a class="mw-pt-progress mw-pt-progress--complete" href="../../uk/Modules/FireBird.html" title="Модулі/FireBird (100% translated)">УкраїнÑька</a></div></div> <table class="wikitable"> <tr> <th> Module </th> <th> Name </th> <th> Version </th> <th> License </th> <th> Source </th> <th> Languages </th> <th> Platforms </th> <th> Type </th> <th> Author </th> <th> Description </th></tr> <tr> <td> <a href="../Modules/FireBird.html" title="Special:MyLanguage/Modules/FireBird">FireBird</a> </td> <td> DB FireBird <ul><li> <b><a href="../Program_manual.html#DBFeat" title="Special:MyLanguage/Documents/Program manual">Features</a>:</b> SQL, LIST, STRUCT, GET, SEEK, PRELOAD, SET, DEL, FIX, TR</li></ul> </td> <td> 3.0 </td> <td> GPL2 </td> <td> bd_FireBird.so </td> <td> en,uk,ru,de </td> <td> x86,x86_64,ARM </td> <td> DB </td> <td> Roman Savochenko<br /> <font size="-2"><i>Maxim Lysenko, 2009 — the page initial translation</i></font> </td> <td> DB module. Provides support of the DBMS FireBird. </td></tr></table> <p>The module provides OpenSCADA with support for the FireBird DBMS, and InterBase, which is a small and embedded DBMS with network functions and support for SQL queries. FireBird is built on the basis of the commercial InterBase DBMS and is distributed under a free license. You can familiarize yourself with the DBMS at <a class="external free" href="http://www.firebirdsql.org" rel="nofollow noreferrer noopener" target="_blank">http://www.firebirdsql.org</a>. The module is based on the database API's library in the language "C" and it allows you to perform actions on databases, tables and table contents. </p> <div class="toc" id="toc"><div id="toctitle"><h2>Contents</h2></div> <ul> <li class="toclevel-1 tocsection-1"><a href="#Operations_over_the_database"><span class="tocnumber">1</span> <span class="toctext">Operations over the database</span></a></li> <li class="toclevel-1 tocsection-2"><a href="#Operations_over_the_table"><span class="tocnumber">2</span> <span class="toctext">Operations over the table</span></a></li> <li class="toclevel-1 tocsection-3"><a href="#Operations_over_the_table_content"><span class="tocnumber">3</span> <span class="toctext">Operations over the table content</span></a></li> <li class="toclevel-1 tocsection-4"><a href="#DB_access"><span class="tocnumber">4</span> <span class="toctext">DB access</span></a></li> <li class="toclevel-1 tocsection-5"><a href="#Productivity_of_the_DBMS"><span class="tocnumber">5</span> <span class="toctext"><span>Productivity of the DBMS</span></span></a></li> <li class="toclevel-1 tocsection-6"><a href="#Notes"><span class="tocnumber">6</span> <span class="toctext">Notes</span></a></li> </ul> </div> <h2><span class="mw-headline" id="Operations_over_the_database"><span class="mw-headline-number">1</span> Operations over the database</span></h2> <p>The operations of opening and closing of the database is supported, with the possibility of creating a new database when you open and delete existing at the close. In terms of the subsystem "DB" of OpenSCADA, opening of DB is its registration for further using of the program. It also supports the operation of requesting the list of tables in the database. </p><p>The FireBird DBMS is addressed by specifying the database file name, user name and password. In general, address of the database is written in this way: <b>{file};{user};{pass}[;{conTm}]</b>. Where: </p> <ul><li> <i>file</i> — full name of the database file;</li> <li> <i>user</i> — user of the database on behalf of which the access is made;</li> <li> <i>pass</i> — password for the user on behalf of which the access is made;</li> <li> <i>conTm</i> — connection timeout, seconds.</li></ul> <h2><span class="mw-headline" id="Operations_over_the_table"><span class="mw-headline-number">2</span> Operations over the table</span></h2> <p>Supports opening, closing tables, with the possibility of creating a new table when opening and removing an existing one when closed, as well as querying the structure of the table. </p> <h2><span class="mw-headline" id="Operations_over_the_table_content"><span class="mw-headline-number">3</span> Operations over the table content</span></h2> <ul><li> scanning of the table records;</li> <li> requesting the values of specified records;</li> <li> setting the values of specified records;</li> <li> removing the records.</li></ul> <p>API of the subsystem "DB" suppose the access to the contents of the table on the value of key(s) fields. Thus, the operation of requesting of the record implies the preset of key columns of the object TConfig, which will do the request. Creating a new record (row) is performed by setting the record values that are missing. </p><p>The module allows you to dynamically change the structure of the database tables FireBird. So, in the case of inconsistency between the structure of the table and the structure of the record being set, the structure of the table will be brought to the desired structure of the record. In the case of requesting the record values and discrepancies between record structures and tables, only the values of the general entries of the record and the table will be obtained. The module does not track the order of the elements in the record and in the structure of the table, in addition to this, the operation of changing the column type is not safe and the data in the changing columns will be lost! </p><p>The module implements the mechanism of supporting multilingual text variables. For fields with a multilingual text variable, columns of individual languages are created in the format " <b>{lang}#{FldID}</b>" (en#NAME). In this case, the base column contains values for the base language. Columns of individual languages are created when needed when saving to a DB and when execution OpenSCADA in the corresponding locale. In the absence of values for a particular language, the value for the base language will be used. </p><p>Types of elements of the FireBird DBMS correspond to types of elements of OpenSCADA in the following way: </p> <table class="wikitable"> <tr> <th> Types of OpenSCADA fields </th> <th> Types of fields of DBMS FireBird </th></tr> <tr> <td> TFld::String </td> <td> VARCHAR, BLOB SUBTYPE TEXT </td></tr> <tr> <td> TFld::Integer </td> <td> INTEGER </td></tr> <tr> <td> TFld::Real </td> <td> DOUBLE </td></tr> <tr> <td> TFld::Boolean </td> <td> SMALLINT </td></tr></table> <h2><span class="mw-headline" id="DB_access"><span class="mw-headline-number">4</span> DB access</span></h2> <p>Access rights to the database are defined by the rights to the DB file. </p><p>Briefly we will look at the initial configuration of the FireBird server to connect for it using by this module: </p> <ul> <li>Install FireBird DBMS by the package or by build.</li> <li>Start DBMS: <pre style="white-space: pre-wrap;"> # Start the classic server $ service firebird start # Start by the superserver processing $ service xinetd restart</pre></li> <li>Setup need pasword for system user "sysdba": <pre style="white-space: pre-wrap;"> $ gsec -user sysdba -pass masterkey -mo sysdba -pw 123456</pre></li> <li>Connect to the DBMS by the module help, enter DB address: <b>"/var/tmp/test.fbd;sysdba;123456"</b></li> </ul> <h2><span class="mw-headline" id="Productivity_of_the_DBMS"><span class="mw-headline-number">5</span> <span id="Tests" title="#Tests">Productivity of the DBMS</span></span></h2> <p>Measurement of the DBMS productivity were carried out by the test "DB" of the tests module "SystemTests", performing operations over the records of the structure: "<b>name char (20), descr char (50), val double (10.2), id int (7), stat bool, reqKey string, reqVal string</b>". </p> <table class="wikitable"> <tr> <th> Operations for 1000 records, seconds </th> <th> FireBird 2.5<br />AMD Turion L625 1.6, 2G, FireBird [2.1.3 Local SuperServer; 100Base-TX; 2.5.2 100Base-TX SuperServer ForcedWrites=Off; ForcedWrites=On]<br /> Intel(R) Core(TM) i3 CPU 1.33GHz, 3G, HDD [2.5.2 100Base-TX SuperServer ForcedWrites=Off; ForcedWrites=On] </th> <th> FireBird 3<br />Intel(R) Core(TM) i7 CPU 2.6GHz, 12G, FastSSD, Local network </th></tr> <tr> <td> <i>Creating:</i> </td> <td> [0.93; 1.15; 4.4; 5.2]; [3.68; 4.67] </td> <td> 0.5 </td></tr> <tr> <td> <i>Updating:</i> </td> <td> [2.74; 2.94; 5.1; 5.2]; [3.88; 4.54] </td> <td> 0.47 </td></tr> <tr> <td> <i>Getting:</i> </td> <td> [1.64; 2.22; 5.0; <span style="color: red">27.8</span>]; [3.69; <span style="color: red">28.8</span>] </td> <td> 2.95 </td></tr> <tr> <td> <i>Seeking:</i> </td> <td> - ; [5.36; <span style="color: red">32</span>] </td> <td> 3.3 </td></tr> <tr> <td> <i>Seeking in preload:</i> </td> <td> - ; [0.045; 0.065] </td> <td> 0.047 </td></tr> <tr> <td> <i>Deleting:</i> </td> <td> [0.65; 1.04; 2.0; 2.4]; [1.69; 1.66] </td> <td> 0.17 </td></tr></table> <h2><span class="mw-headline" id="Notes"><span class="mw-headline-number">6</span> Notes</span></h2> <p>The DBMS FireBird has more architecture's limits and problems by the InterBase inheritance and from parent OS MS Windows which prevent it wide using for more tasks. Known limits and problems: </p> <ul><li> The DBMS is slow comparing to MySQL or PostgreSQL, see to the previous chapter. Especially for the mode ForcedWrites On(sync).</li> <li> The DBMS has fixed limit for plain SQL statement size to 65536 KB, which prevents for big content placing just SQL.</li> <li> Classic server on Linux, for disabling the mode ForcedWrites, can dead hang.</li> <li> Time limits control for the connections is missed, which caused to long and uncontrolled waiting for client applications.</li></ul> </div><table style="border-top: dotted 2px #999999; margin-top: 20pt; color: gray;" width="100%"><tr><td style="text-align: left;" width="40%"><a href="http://oscada.org/wiki/Modules/FireBird/en">Modules/FireBird/en</a> - <a href="http://oscada.org/en/main/about-the-project/licenses/">GFDL</a></td><td style="text-align: center;">April 2025</td><td style="text-align: right;" width="40%">OpenSCADA 1+r3018</td></tr></table></body> </html>