Installing firebird 2.5. Installing Firebird on Windows


DBMS (abbreviation for Database Management System) is a set of language and software tools designed for creating, maintaining and sharing a database at the same time by several users. A database management system is an intermediary between the database itself and its users.

The Firebird DBMS, used in the RKC: Office software package, is a cross-platform database management system that runs on Microsoft Windows, Linux, and various Unix platforms. Firebird has been used in a variety of industrial systems (warehouse and utility, financial and government sectors) since 2001. This is a commercially independent project of C and C++ programmers, most of whom live in Russia. Firebird is completely royalty-free, even for commercial use.

Preparatory stage

Before you begin installing Firebird, you need to make sure that the computer you plan to use as a server does not have another copy of Firebird or Interbase installed. To do this, go to Control Panel Microsoft Windows and select Programs and components.

Windows Control Panel

If Firebird of another version (for example, 1.5 or 2.1) is installed on your computer, then you need to remove them. The same applies to all versions of Interbase.

After uninstalling previous versions of Firebird, download the Firebird 2.5 DBMS distribution kit from the official developer website, or download it from our website using the following link.

Installation

After successfully downloading the distribution (this is an executable file whose name contains the text Firebird-2.5), launch it by executing Windows Explorer double-click on the file name with the left mouse button, or by selecting this file and pressing the Enter key on your computer keyboard.

Firebird 2.5 distribution file

If you are not running on a computer with full System Administrator rights, then Windows will most likely ask you whether the application you are running can make configuration changes. Answer affirmatively to the question asked and the Welcome page of the Firebird Installation Wizard will open in front of you.

Firebird Installation Wizard Start Page

Firebird License Agreement

Agree to the terms of the license agreement and click the button again Further. Keep pressing Further until the following window appears:

Selecting Firebird Components to Install

In this window, the wizard asks about the server components that it will need to install. When choosing, be guided by the following rule: if your organization uses a regular office computer as a server, and there are no more than 10 concurrent users, then select SuperServer. Otherwise - ClassicServer.

Refusal to create a folder in the Start group

On the next page of the wizard, choose not to create the folder in the Start menu and click the button again Further.

Additional Firebird Installation Wizard Tasks

In the additional tasks window, refuse to install Guardian, select to run as a service, and also clear all flags except Automatically launch Firebird on every boot. After this, press the button again Further, and then, on the next page, the button Install.

Final page of the Firebird installation wizard

Once the process of copying the server files is completed, you will see the final installation window. Uncheck the box next to the item After Installation - What Next? and press the button Complete.

Setting up a firewall

To be able to connect to the Firebird DBMS from other computers on your organization’s local network, you need to open port 3050 in the Windows firewall settings (if the local network server does not have an Internet connection, the firewall service can be completely disabled, although this is not recommended from a security point of view). Setting up the Windows Firewall is as follows (to perform the described steps, you must have Administrator rights on the computer used as the server):

Adding the Firebird DBMS to Windows Firewall exceptions. Step 1.

Adding the Firebird DBMS to Windows Firewall exceptions. Step 2.

Adding the Firebird DBMS to Windows Firewall exceptions. Step 3.

Adding the Firebird DBMS to Windows Firewall exceptions. Step 4.

Adding the Firebird DBMS to Windows Firewall exceptions. Step 5.

Please note that the utility mentioned in some manuals instreg, which is used to register (and unregister) a Firebird installation in the Windows registry, should absolutely not be used if several instances of Firebird 2.5 are used on one server. Otherwise, the correct joint operation of several Firebird instances on one server may be disrupted. If, for some reason, the system previously used the instreg utility, or simply installed a “default” Firebird instance using the standard installer ( exe-file), during which instreg is called, then before starting several services with different Firebird instances, you must first remove information about the Firebird installation using the command instreg remove.

In our example, setting up Firebird services is performed on a clean system and without using an installer, so first executing the command instreg remove we won't need it.

So, let's start registering Firebird instance services.

Open a command line with Administrator rights, go to the directory with the executable files of the first Firebird instance and execute the command to register the instance service using the utility instsvc(you can request information about the utility keys and its version by starting with the option -z):

Cd /d D:\FBInst1\Bin\bin instsvc -z instsvc install -superserver -demand -name Instance1

In the registration command we use the following options:

    install– installation of a new Firebird instance

    superserver– instance operation mode (one of three possible modes for Firebird 2.5)

    demand– the service being created is configured to be started manually (this is necessary in order to perform its preliminary configuration before starting the service)

    name– the name of the Firebird instance that will be served by the created service.

When executing the last command, we should receive a message indicating that the service was successfully registered.

By analogy, we register the service of the second Firebird instance, making sure to first go to the appropriate directory:

Cd /d E:\FBInst2\Bin\bin instsvc install -superserver -demand -name Instance2

Now let's go to the Windows Service Management snap-in ( services.msc) and make sure that two new services have appeared in the list of services and both of them are in an unstarted state.

Let's open the service properties of the first Firebird instance and on the tab General configure the automatic service startup type

Let's switch to the tab Log On and select the service account we created earlier gMSA, on behalf of which this service should run. Please note that since the gMSA account is used, the “$” symbol must be present at the end of the name, and the password field should be left empty (the server OS will itself authenticate this account in the domain). When saving settings using the button Apply we will receive a message that the account we specified has been automatically added the right to log in as a service ( Log On As A Service)

Let's switch to the tab Recovery and configure automatic restart of the service if it crashes. Of course, everyone sets the restart rules at their own discretion. In our example, two restart attempts are left, and the third and subsequent attempts are disabled (so as not to introduce the service into an endless cycle of restart attempts in the event of any significant problems).

By analogy, we configure the second service, which was created for the second Firebird instance. For the second service, all settings can be similar, with the exception of the account under which it will be launched. After the Firebird instance services startup parameters are configured, let's try to start them.

Services should start without long delays or errors.

Let's make sure that after starting the services from each of the Firebird instances, the TCP-listener for accepting client connections on a previously specified port.

Netstat -na | findstr 305

Don't forget to open the appropriate ports in Windows Firewall. This can be done quickly, for example, using PowerShell:

New- NetFirewallRule -DisplayName "Firebird Server (Instance1)" - Direction "Inbound" ` - Protocol "TCP" - Action "Allow" - LocalPort "3051" New- NetFirewallRule -DisplayName "Firebird Server (Instance2)" - Direction "Inbound" ` - Protocol "TCP" - Action "Allow" - LocalPort "3052"

Now both deployed Firebird instances can be considered running and ready for use.

Store automation based on the Firebird server is cost-effective because, despite being free, it is a full-fledged SQL server, powerful and reliable enough to satisfy the needs of an average holding company.

In our practice, the Storehouse Explorer system based on the Firebird server was used to automate a holding of 50 stores throughout Russia. The size of the database exceeded 30 GB, the database contained information for 10 years and simultaneously served from 70 to 120 users (trading operations and analytics).

>> Download demo version<<

Installing a Firebird server on UNIX has its own characteristics, which we would like to reflect in this article.

Shop automation based on Firebird 2.5 server on POSIX (UNIX, LINUX) platforms

Preface

This article describes how to install Firedird 2.5.2 server on POSIX (Unix-like) operating systems such as Linux, Unix.

Please note the following before installation.

  1. To install the Firebird server you will need root user rights.
  2. If you are installing Firebird on Linux, then before installing you must make sure that the system has the libstdc++.so.5 run-time library. If this is not the case, then you should install the compat-glibc package (RedHat, CentOs, OpenSuse, Debian) or the libstdc++5 package (Mandriva).
  3. If you are planning to install Firebird with the SuperServer architecture on Linux, which supports the new POSIX threading model, then you should choose the NPTL build of Firebird.

I. Selecting a distribution

There are quite a lot of Firebird distributions of different versions and developed for different operating systems.
At the time of writing this article, a stable build of this server version 2.5.2 is available, which can run on
32-x and 64-bit platforms Windows, LINUX and MacOSX.
However, before choosing the right distribution, you need to make a small digression.
There are several versions or architecture options for the Firebird server, namely Classic, SuperServer
and Embedded. They differ in the way they use machine and network resources. Without going deeply into details, we will briefly note the features of these architectures:
Classic- formally can be described by the formula “n connections to the database - n processes on the server”, i.e. every connection to the database

starts its *process* on the server. It works like this. On POSIX platforms, the [x]inetd daemon runs, which
listens on a port (by default it is port 3050, but if necessary, you can assign another one). This daemon starts a *separate* fb_inet_server process for each successful connection. Each process consumes certain server resources and creates a separate memory cache.

The SuperServer architecture uses computer resources more economically.
SuperServer can be briefly described by the formula “n connections to the database - one process and n *threads* on the server.” On POSIX systems this is the fbserver process. Superserver is a multi-threaded application, unlike the Classic architecture. Each connection is serviced in a separate thread.
Embedded- this is an architecture that operates as part of a separate application and in the usual sense is not a “full server”, i.e. is not intended to work as a server that serves many connections.
Most likely, you will make a choice between the Classic and Superserver architecture. If it is not possible to go deeply into details, then you can make a choice arbitrarily. The format of the database itself is in no way tied to a specific Classic or Superserver architecture and it is always possible, if necessary, to reinstall the server by choosing a different architecture.
And although, most likely, either architecture of these two will suit you, there is an opinion that for beginners who have just started working with Firebird, the Classic architecture is more preferable for learning and experimenting with Firebird, as it is more resistant to incorrect user actions.
Note that the Superserver uses a shared memory cache and may have some advantages in the case of a large number of concurrent users. The superserver is limited in the size of the RAM used; at the time of writing, it cannot use memory exceeding 2Gb.
The Classic architecture can also be preferred if the hardware uses several processors and has significant RAM (> 2 GB).
This article is not intended to provide a detailed analysis and comparison of these architectures; more detailed information about this can be found on the Internet.

II. Selecting an installation method

To install Firebird, you must have root user rights.
The Firebird server is a free product; the distribution kit for its installation can be downloaded from the official website of the Firebird Foundation www.firebird.org.
Distributions are generated as *.rpm or *.tar.gz files, for example:

FirebirdCS-2.5.2.26539-0.i686.rpm

FirebirdCS-2.5.2.26539-0.i686.tar.gz

It should be noted that not all Linux builds support rpm installation; this can be clarified in the platform documentation in the “RPM Package Manager” section. In such cases, it is recommended to use "tar.gz" files.
On the Internet there are descriptions of manual installation methods by unpacking the archive and copying files, but such methods, if installers from the developer are available, are not recommended.

III. Installing Firebird 2.5 server

For example, let's take the installation of a Classsic architecture server.
Log in as root.
To install a *.rpm file, type:

$rpm -ivh FirebirdCS-2.5.2.26539-0.i686.rpm

To install a *.tar.gz file, type:

$tar -xzf FirebirdCS-2.5.2.26539-0.i686.tar.gz

$cd FirebirdCS-2.5.2.26539-0.i686.tar.gz

After running the installation scripts, the following actions will be performed:

  1. An attempt will be made to stop all running Firebird servers.
  2. If not yet created, the user will be created " firebird"and the band" firebird".
  3. To catalog /opt/firebird the software will be installed in the directory /usr/lib links will be created
  4. for libraries, to catalog /usr/include file headers will be placed.
  5. To catalog /etc/services a gds_db entry will be added for port 3050 if such an entry does not already exist.
  6. Localhost.localdomain and HOSTNAME will be added to the directory /etc/gds_hosts.equiv.
  7. If SuperServer is installed, only the server startup script will be installed /etc/rc.d/init.d/firebird.
  8. If Classic is installed, the launch script will be installed /etc/xinet.d/firebird or, for some lower versions of inetd systems, an entry will be added to /etc/inetd file.
  9. New links will be added to /usr/bin for the init.d script and a Firebird server configuration entry will be created in etc/rc.config.
  10. The server/service will start and Firebird should start automatically.
  11. The SYSDBA user password will be randomly generated and written to a file /opt/firebird/SYSDBA.password.
  12. An alias for the test database employee.fdb will be added to aliases.conf.

At this stage, you can check whether the Firebird server is installed correctly. To do this, we need the SYSDBA account password, which can be extracted from the /opt/firebird/SYSDBA.password file.
Let's type on the command line:

$cd /opt/firebird/bin

$./isql -user sysdba -password

SQL>connect localhost:employee.fdb;

SQL>select * from sales;

Using these commands, the Firebird server connects to the test database employee.fdb and retrieves all records from the sales table.
The Firebird server, by default, runs as the user "firebird". Previously, by default, the server ran as "root". Running the server as "root" is not very correct from a security point of view , because the "root" user has the highest rights in the system and can create and delete any files and directories within the entire file system. Such rights are unnecessary for the Firebird server, so you should check and configure the server to run as the "firebird" user.

For this:

  1. The user "firebird" must have write permissions to the directory in which the databases will be created.
  2. The DatabaseAccess parameter in the /opt/firebird/firebird.conf file must be configured to deny access to all files and directories except those intended for storing databases. If in the aliases.conf file we create an alias for a file, then in the firebird.con file we must give access to this file.
  3. It is recommended (desirable, but not required) to always use aliases to indicate abstract links to database files, without specifying their specific physical location.

Using the example of creating an empty database test.fdb, we will make sure that the creation of the Firebird server was successful.
There is more than one way to create an empty database (for example, on the client, using the IBExpert application),
Here we offer the simplest method, using standard Firebird tools on the server.
Select a directory for placement var/firebird.
So, you need to:
1. check for presence and, if not, create the /var/firebird directory. If the owner of this directory is not the user "firebird", then you should change the owner to "firebird":

$mkdir -p /var/firebird

$chown firebird:firebird /var/firebird

2. In the /opt/firebird/firebird.conf file, add permission to create a database in the /var/firebird directory.

DatabaseAccess = Restrict /var/firebird

3. create a database

$/opt/firebird/bin/isql -u SYSDBA - p

SQL>connect "/var/firebird/test.fdb";

In practical work with the Firebird server, some tools may be useful:
- changeDBAPassword.sh- script for changing the SYSDBA password.
- createAliasDB.sh- a script for creating an empty database, creating an alias and writing it to aliases.conf;
Usage example:

$createAliasDB.sh

IV. If something went wrong...

If it suddenly turns out that just yesterday the Firebird server was working great, but today it doesn’t start, or starts but doesn’t work properly, then perhaps studying the firebird.log will help you solve the problem.

V. Installing Firebird on Solaris, FreeBSD, Debian platforms

At the time of writing, installation of Firebird 2.5 for the Solaris, FreeBSD, Debian operating systems is not yet available; use previous versions of Firebird, for example 2.0.

(c) Milkevich Taras
Polaris-Soft team,

Literature:

1. Firebird 2 Migration & Installation, Helen Borrie (Collator/Editor) 6 April 2008 - Document v. mi210_20 - for Firebird 2.1.
2. Interbase world. Architecture, administration and development of database applications in Interbase/Firebird/Yaffil. 2nd edition, expanded. Alexey Kovyazin, Sergey Vostrikov, KUDITS-OBRAZ, Moscow 2003.

Firebird SQL Server— database server based on open source InterBase 6.0. Firebird distributions exist for Windows, Linux, Unix, Solaris, MacOS, for 32-bit and 64-bit architecture. Firebird SQL Server is distributed free of charge and has no licensing restrictions.

Which version of Firebird should I choose?

Currently the newest version is Firebird 3.0. Stable version of Firebird 2.5.

Installing Firebird - selecting server type

Firebird SQL Server is available in 3 versions:

  • Firebird Super Server
  • Firebird Classic Server
  • Firebird Embedded

Firebird Super Server

Firebird Super Server— all client connections are serviced by one server process, there is a common client cache. This results in less resource consumption for customer service. Disadvantage Firebird Super Server is the inability to use multiple processors to run the Firebird server.

Firebird Classic Server

Firebird Classic Server— creates a separate server process for each client connection. Architecture Firebird Classic Server more reliable, because The failure of one server process does not cause a denial of service to all clients. In addition, Firebird Classic allows you to use multiprocessor architecture. When installing Firebird you can choose between versions Firebird Super Server or Firebird Classic Server.

Firebird Embedded

Firebird Embedded Server— designed for embedded databases. Consists of one dll - fbembed.dll, which includes the Firebird Super Server client and server. Firebird Embedded does not require installation on the client workstation. It is enough to simply copy fbembed.dll and a few other files to the client’s computer.

The disadvantage of Firebird Embedded is the inability to simultaneously connect several clients to one database. After a successful connection, Firebird Embedded locks the database file for exclusive access.

Firebird Embedded Server distributed as a separate distribution.

If you find it difficult to choose

If you are unsure about the installation type Firebird, then use Firebird Super Server. In the future, you can easily change the server architecture.

Getting started with Firebird

To get acquainted with Firebird, you can use the test database employee.fdb. It is included in the installation kit Firebird and is located in the folder Program Files\Firebird\Firebird\examples\empbuild\.

Creating a new Firebird database

To create an empty Firebird database:

  • run the utility C:\Program Files\Firebird\Firebird\bin\isql.exe
  • execute the database creation instruction:
Use CONNECT or CREATE DATABASE to specify a database SQL> CREATE DATABASE ‘localhost:d:\temp\test.fdb’ user ‘SYSDBA’ password ‘masterkey’ DEFAULT CHARACTER SET WIN1251;

In ISQL, every expression ends with a semicolon.

You can check your connection by running the following request:

SQL> select MON$DATABASE_NAME from MON$DATABASE;

If everything is done correctly, the SQL query will return the path to the connected database:

===================================================== ======================== D:\TEMP\TEST.FDB

Firebird Security

  • Firebird stores all users in one service database, security.fdb.
  • Starting with Firebird 2.1, support for SSPI authentication using Windows has been implemented. Domain administrators at the database level are defined as SYSDBA superusers.
  • Firebird 3.0 plans to implement the ability to store users in a client database.

User SYSDBA. Changing the default password

SYSDBA is the Firebird administrative user with exclusive rights. Default password: masterkey. To change the password, use the utility gsec from Firebird:

C:\Program Files\Firebird\bin>gsec GSEC> modify SYSDBA -pw NEW_PASS

Using the gsec utility, you can create, delete, modify, and view users. A complete list of commands can be obtained by typing help.

Connecting to Firebird from a client application

To get started, download and install the IBProvider Professional Edition package.

IBProvider Professional Edition is a set of COM components that allow you to work with any version of Firebird and InterBase. The components are supported by most development tools: Delphi, C++ Builder, Visual C++, .Net Framework, C#, Visual Basic, VBScript, VBA, etc.

For check connections to Firebird let's write a simple one script in VBScript. Create an empty file with a vbs extension and paste the following code into it, specifying the correct database path:

Dim cn, cmd, rs, i Set cn = CreateObject ("ADODB.Connection") cn.Open "Provider=LCPI.IBProvider.3;" & _ "Data Source=localhost:d:\temp\test.fdb; " & _ "User Id=SYSDBA;" & _ "password=masterkey;" & _ "ctype=win1251;" & _ "auto_commit=true" set rs = cn.execute("select * from MON$ATTACHMENTS") do while not rs.EOF for i=0 to rs.Fields.Count - 1 wscript.echo rs(i).Name & "=" & rs(i).Value next rs.MoveNext loop rs.close cn.close

Run the script in command line mode and you will see a list of active database connections.

Firebird and VBScript, Visual Basic, VBA

To access Firebird and InterBase from VBScript, VBA, Visual Basic The ADO (ActiveX Data Objects) library is used. You will find many examples of working with this library in the documentation: examples InterBase, Firebird VBScript, VBA, Visual Basic.

Firebird and Delphi

IBProvider offers several ways to work with InterBase and Firebird from Delphi:

  • dbGo (ADO Express) components working through the ADO library.
  • direct access to ADO COM interfaces, bypassing dbGo components.
  • direct access to OLE DB COM interfaces using third-party VCL components (OLE DB Direct/OLE DB Express).

Firebird and .Net

To access Firebird from .Net, the ADO.NET library is used. The IBProvider website has published a large step-by-step guide dedicated to working with Firebird in Visual Studio .Net (ADO.NET).

Additional materials on the topic:

Firebird and C++

IBProvider Professional Edition includes a C++ library, which provides the fastest way to work with OLE DB providers from Visual C++ 2005-2008, as well as from C++ Builder.

Editing the Firebird database

In an empty database, you need to create tables, relationships between tables, primary keys, indexes, stored procedures, generators, and other objects. To edit Firebird databases, you can use the isql.exe utility.

Create a table:

SQL> CREATE TABLE cross_rate CON> (CON> from_currency VARCHAR(10) NOT NULL, CON> to_currency VARCHAR(10) NOT NULL, CON> conv_rate FLOAT NOT NULL, CON> update_date DATE, CON> CON> PRIMARY KEY (from_currency, to_currency ) CON>);

We insert one record and make a selection from the table:

SQL> INSERT INTO cross_rate VALUES ('Dollar', 'CdnDlr', 1.3273, '11/22/93'); SQL> SELECT * from cross_rate; FROM_CURRENCY TO_CURRENCY CONV_RATE UPDATE_DATE ============= =========== ============== ======== === Dollar CdnDlr 1.3273000 1993-11-22

In addition to isql, there are various graphical Firebird administration utilities.

Firebird Administration Utilities

FlameRobin

FlameRobin- supports Firebird. Cross-platform architecture. There is a SQL editor, DDL, user management.
License: open source, distributed free of charge.
Website:

IBExpert

IBExpert- Supports Firebird, InterBase, Yaffil. DDL and DML editors. Visual query builder. Code completion, Metadata Extractor, and many other features.
License: Free for exUSSR, for others: from 179 euros.

Let's look at a detailed step-by-step procedure for installing a Firebird server running on the Microsoft Windows platform.

Shgg 1

Download Firebird from the official server page or from , you need server version 2.1 and higher. Then run the exe file. A window will appear where you will need to select the installation language.

Shagg2

After selecting the language, the Firebird installation wizard appears, which will help you install the server:

Step 3

Here we are provided with a license agreement.

To proceed to the next step, you must accept the terms of the agreement. By selecting " I accept the terms of the agreement" and clicking "Next", we will see a window with additional information about installing the program:

Step 4

Now we must select the folder where we want to install the server. By default, we are offered the installation path shown in the figure, but it can be changed to any other one.

Step 5

At this step you need to select database server configurations:

To install Firebird on a computer server (where the database itself will be located), specify "Complete installation of server and development tools":

In addition, at this step you need to select the Firebird server configuration: Classic Server or SuperServer. In order not to go into a description of the differences between Classic Server and SuperServer, we suggest you choose the Firebird server type according to the following criteria:

If the installation is carried out on a server machine or multiprocessor station with a relatively large number of connections (more than 30), then choose Firebird Classic and S3rver.

If the number of connections is small or the workstation is not powerful enough, install SuperServer

If we talk about the details of the implementation of Classic Server and SuperServer, then Classic Server launches a separate server process for each connected client, and SuperServer processes all clients in one process.

Step 6 g Creating a folder in the menu Start

Step 7

At this stage of installation, you need to select additional parameters for the server:

o Uncheck " Use Guardian to manage your server".

o Select " Run as a Service".

Why is Firebird Guardian needed?

Firebird Guardian is an application that monitors the presence of the Firebird process. If the server has been stopped, it will automatically start it. To run as a service, there is no point in using this function since Windows itself restarts services that were terminated after an error.

If you are installing the Firebird server on Windows Vista, then check "Install Panevi Control Applet"needs to be removed.

Sha 8

We have selected additional tasks for the server, after that everything is ready for installation - click Install:

After the process is completed, a window appears with information that is recommended to be read:

Step 9 - Launching Firebird

At the end of the installation, you will be prompted to start the Firebird SQL Server service. Click "End". So, we have installed the server on our computer. To manage Firebird (stop/start services) you must open Control panel and double click to open "Firebird 2.1 Server Manager":







2024 gtavrl.ru.