Wednesday, March 5, 2014

Firebird Database with Debian

Usind firebird as database with Debian

Before we install the database here a short overview of the different versions:

Classic Server
The classic server uses for each connection a different task. On multiprocessor systems the server uses all cores to share the usage.
Best performance for a small  number of connections.

The superserver uses only one process and for each connection a thread. All connections use the same cache. Multiprocessing is not supportet. On server with more than one cpu there is no more performance improvement.
Best performance on many connections.

Superclassis uses a thread for each connection and one cache, but supports multicore cpu's. Combination of the advantages of both systems but only available at firebird 2.5 or higher.


For installation i used aptitude:

aptitude install firebird2.5-superclassic

With this command aptitude installed the needed packackes. For using the database we need the user and group "firebird" and the masterpassword. For creating this we use the package manager dpkg-reconfigure:

dpkg-reconfigure firebird2.5-superclassic

While the package manager is creating the database he ask for the masterpassword for the mainuser.

The config files can be found here: /etc/firebird/2.5

At the config file firebird.conf i changed nothing. The aliases.conf i used for creating an database alias. So we can use the database without the complete path to the database file. When not using an alias you must set the complete path to the file from view of the server.

# ------------------------------
# List of known database aliases
# ------------------------------
# Example Database:
employee.fdb = /usr/share/doc/firebird2.5-common-doc/examples/empbuild/employee.fdb
employee = /usr/share/doc/firebird2.5-common-doc/examples/empbuild/employee.fdb
# Live Databases:
datenbank = /daten/datenbank.fdb

Here i create the alias "datenbank" for the database file  /daten/datenbank.fdb
It is importent to check the permissions of the database file and the complete path to it.

For creating a user of firebird we using gsec.

gsec -user sysdba -pass hauptpassword -add benutzername -pw benutzerkennwort

Here we create the user "benutzername" with the password "benutzerkennwort" while using the mainuser "sysdba" and his password "hauptpassword" whis was created during the installation with dpkg-reconfigure.

When everything is done we restart the database:

/etc/init.d/firebird2.5-superclassic restart

1 comment:

  1. Very nice walk-through, for me it worked flawlessly and saved me some effort to install on Debian! Thanks!