TVs. Consoles. Projectors and accessories. Technologies. Digital TV

Instructions for installing the Firebird database server. Let's start working with Firebird Sql Server firebird linux won't start

Running Firebird on Linux/UNIX

Superserver

The default installation directory is /opt/firebird. In the /bin directory it is in binary format Firebird server fbserver (ibserver for Firebird 1.0.x), which runs as a daemon process on Linux/UNIX. It runs automatically after installation via RPM or script and every time the server is rebooted by running the firebird daemon script located in /etc/rc.d/init.d (or /etc/init.d in SuSE) which calls the utility command line Firebird Manager - fbmgr.bin. Firebird Manager can be used from the command line to manually start and stop a process.

Starting the server

If you are various reasons started Firebird manually, connect to it as root or firebird user. Remember which account you used when running fbserver, because all objects created will be owned by the user with that account. If another user later starts the process using a different user account, then these objects will not be available to him.

To start the process, run the following command from the command line:

./fbmgr.bin -start -forever

./ibmgr -start -forever

The -forever switch means that Guardian will control the launch. When using Guardian, the server process will be restarted if it crashes for any reason.

To start the server without using Guardian, enter:

./fbmgr.bin -start -once

For versions of Firebird earlier than 1.5, run:

./ibmgr -start -once

The -once switch means that if the server crashes, it can only be restarted manually.

Stopping the server

For security reasons, if possible, ensure that all database connections are disconnected before you stop the server.

The -shut switch cancels all ongoing transactions and shuts down the server immediately.

You do not need to be logged in as root to stop the Firebird fbmgr server, but you must have SYSDBA user privileges. Run the following command.

./fbmgr.bin -shut -password<пароль SYSDBA>

Use the command for versions earlier than 1.5:

./ibmgr.bin -shut -password<пароль SYSDBA>

Controlled Shutdown

On this platform, Firebird does not have a utility for counting the number of user database connections for the SuperServer. If you need to give clients a window of time to shut down and shut down gracefully, shut down individual databases using the gfix tool with the -shut switch and one of the available shutdown control arguments. (See "Stopping the Database" in Chapter 39.)

Other fbmgr commands

Syntax

From the command line:

./fbmgr.bin -command [-mode [parameter] ...]

Alternatively, you can start an interactive fbmgr or ibmgr session from the command line (for example, by going into prompt mode). Dial:

./fbmgr<нажмите Return/Enter>

to move on to the next prompt:

In prompted mode, the command syntax is:

FBMGR> command [-mode [parameter] ...]

For example, you can start the server using one of the following methods. From the command line:

./fbmgr -start -password password In prompt mode:

FBMGR> start -password password

fbmgr switches

In table 4.1 provides a list of fbmgr and ibmgr switches available from the command line and from prompt mode.

Table 4.1. fbmgr/ibmgr switches

Switch

Argument

Other switches

Description

User, -password

Starts fbserver if it is not already running

User, -password

Stops fbserver

Shows host and user

Username

SYSDBA; used with the -start and -stop switches if the system user is not root or equivalent

Password SYSDBA

Used with the -start and -stop switches if the system user is not root or equivalent

Displays short help text fbmgr

Used to exit guided mode

From the book Fedora 8 User Guide author

1.1.3.1. Running the Linux Installer The first step is to set up your computer to boot from a CD. Usually, when you start your computer, you see a message on the screen: Press DEL to enter SETUP or Press F2 to enter SETUP In the SETUP program, you need to configure the computer to boot from CD/DVD (Fig. 1.2), If you

From the Linux for the User book author Kostromin Viktor Alekseevich

Chapter 3. First launch of Linux OS 3.1. Booting Linux OS So, the Linux installation is complete, and you restart your computer. If Linux is the only one operating system installed on your computer (which means the LILO boot loader is located in the master boot record - MBR), then after

From book 200 best programs for Linux author Yaremchuk Sergey Akimovich

P5. To Chapter 3 “Starting the Linux OS for the first time” 1. On Alexey Makhotkin’s page (http://alexm.here.ru/manpages-ru/index.html) you can find translations of man pages into Russian. 2. Guido Gonzato, “From DOS/Windows to Linux HOWTO”, translated by Alex Ott, v1.3.2, February 22, 1999 (http://linux.webclub.ru/howtorus/doswinhow/dos-win-to-linux-howto .html). This is very useful material

From the book Application Development in the Linux Environment. Second edition author Johnson Michael K.

Launch Windows games for Linux There are few games for Linux. Linux has plenty of non-casual games to kill time; when installing the distribution, the user will find several dozen of them. There are also OpenSource projects offering quite serious games in a wide variety of

From the Linux book: Complete Guide author Kolisnichenko Denis Nikolaevich

17.4.4. Running the Unix Domain Examples The two previous example programs (server and client) are designed to work together. Start the server from one terminal, then activate the client from another terminal (but in the same directory). When entering lines in

From the book Firebird DATABASE DEVELOPER'S GUIDE by Borri Helen

1.8. Starting Linux for the first time If you choose to login graphic mode(or the installer chose it himself without asking anything), then you will see graphic screen with a name and password input field. Register in the system (preferably under the name you created for your regular

From the book Linux Programming with Examples author Robbins Arnold

Starting the Firebird server in Windows Superserver The executable program of the Firebird Superserver is fbserver.exe. Although it can be launched as independent program, it can also be controlled by Guardian - fbguard.exe. Guardian provides the ability to emulate automatic restart

From the book InterBase World. Architecture, administration and development of database applications in InterBase/FireBird/Yaffil author Kovyazin Alexey Nikolaevich

Installing the Linux/UNIX client POSIX operating systems are quite unique. The advice in this section should be useful as a guide to installing clients for most flavors of Linux and UNIX, but this is an area of ​​doubt.

From the book Programming for Linux. Professional approach by Mitchell Mark

1.1. Model file system Linux/Unix One of the driving goals of the original Unix project was simplicity. Simple concepts are easy to learn and use. When concepts are translated into simple APIs, it's easy to design, write, and debug simple programs. In addition, simple code

From the book Linux Kernel Development by Love Robert

From the book Linux Mint and his Cinnamon. Application essays author Fedorchuk Alexey Viktorovich

From the author's book

4.1. Introduction to the Linux/Unix I/O Model The Linux/Unix API model for I/O is simple. It can be summed up in four words. open, read, write, close. In fact, these are the names of the system calls: open(), read(), write(), close(). Here are their declarations: #include /* POSIX */#include

From the author's book

Installing InterBase on a Linux/Unix platform Installing InterBase on Linix is ​​a little more complicated than on Windows if you are not an expert in this OS. For Linux InterBase (as well as Firebird) there are two server architecture options - SuperServer and Classic. About their differences, as well as about their advantages and disadvantages

From the author's book

Part I Complex programming issues in the environment

From the author's book

The Linux kernel compared to classic Unix kernels Due to their common origins and the same API, modern Unix kernels share some common characteristics. With few exceptions, Unix kernels are monolithic, static binary files. This means that they

From the author's book

Resources on Linux and UNIX in general Here, first of all, we should mention Linux in Russian - the site of Viktor Kostromin, which he has been running since 1999. And which, on the one hand, is the most complete catalog of links to Russian-language resources on our topic, and on the other hand, contains

Please note that the utility mentioned in some manuals instreg, which is used to register (and unregister) a Firebird installation with Windows registry, if several instances of Firebird 2.5 are used on one server, it should absolutely not be used. Otherwise correct collaboration Multiple Firebird instances on the same server may be broken. 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, Firebird services are configured on clean system and without using the installer, so pre-executing the command instreg remove we won't need it.

So, let's start registering Firebird instance services.

Open a command prompt 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 control snap-in Windows services (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 should be executed this service. 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 for the specified account automatically added the right to log on as a service ( Log On As A Service)

Let's switch to the tab Recovery and set up an 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.

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

Shgg 1

Download Firebird from the official server page or from , you need server version 2.1 and higher. Then run executable file eh. 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 go to 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 that you select 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 a large number 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 implementation details 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 options 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":

DBMS (abbreviation for Database Management System) is a set of linguistic and software, 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.

Firebird DBMS used in software package RKTs:Office is a cross-platform database management system running on Microsoft Windows, Linux, and a variety of 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 removal previous versions 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 yes to asked question and the Firebird Installation Wizard welcome page 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 Next. Keep pressing Next 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 next page wizard, choose not to create a folder in the Start menu and click the button again Next.

Additional Firebird Installation Wizard Tasks

In the window additional tasks do not install Guardian, choose to run as a service, and clear all flags except Automatically launch Firebird on every boot. After this, press the button again Next, 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 complete, 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 local network your organization needs to open port 3050 in settings Windows Firewall(If the local network server is not connected to the Internet, then 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.

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?

At the moment newest version- Firebird 3.0. Stable version 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 impossibility simultaneous connection to one database of several clients. 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, 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 has been implemented using Windows. Domain administrators at the database level are defined as SYSDBA superusers.
  • Firebird 3.0 plans to implement the ability to store users in client base data.

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. Full list 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.

To 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 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 that provides the most quick way working 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.

Related publications