Instructions for installing the Firebird database server. Other questions How to stop a running firebird server

Running the server as an application manually

If the Superserver is not running, or the Classic Server is not initialized, it can be started manually by selecting Firebird - Start | All programs | Firebird (Start | Programs | Firebird).

Alternatively, you can start the server or Guardian from the command line. Open a command prompt window and navigate to the bin directory in your Firebird installation directory. Follow these steps depending on whether you are going to use Guardian or will be running a server without the ability to automatically restart.

Superserver

The Guardian program is called fbguard.exe in Firebird 1.5 and idguard.exe in earlier versions. Use the following command to start Guardian:

ibguard.exe -a /* for version 1.0.x */

Guardian places its icon on the system tray and the Superserver automatically starts.

The name of the server program for the Superserver is fbserver.exe (ibserver.exe in Firebird l.O.x). To launch the Superserver directly, bypassing Guardian protection, use the command:

ibserver.exe -a /* for version 1.0.x */

The server starts and places its own icon on the system tray.

Classic server

NOTE. This text applies to Firebird 1.5 and later. Classic Server for Windows is not supported in earlier versions.

The main advantage of running Classic Server on Windows is its ability to use multiprocessor systems. This feature is not available with Super Server for many SMP systems. However, because Classic Server's memory usage is directly related to the number of concurrent connections, it may not be possible to install the system in sites where the server resources do not support a large number of users on the system.

The process that acts as the "ear" for client requests to connect to the Classic Server is the initial instance of the fb_inet_server.exe program. If the initial instance of fb_inet_server.exe is not running, then client-server communication will not be possible; When you try to connect, you will receive the error message "Unable to connect to the server. Database cannot be found."

When clients connect to the database, one instance of fb_inet_server.exe (1.2 MB) is started for each client connection and, if configured, one instance of Guardian for all instances of fb_inet_server.exe. Each connection has its own cache allocation.

Classic server and Guardian

Whether by accident or design, the Firebird 1.5.0 installer has a small but disconcerting anomaly. If you do not check the Use Guardian option during the installation process, the installer will place the Superserver version of the Guardian program in the bin directory, and it will never work with the Classic server. If you check this mode, you will receive an error message during the installation process, but the installed version of Guardian will work fine with the Classic server. You can check if you have the correct version by trying to launch Guardian. If you see an error dialog containing the word "fbserver", you did not select Guardian support during the installation process.

In any case, Guardian is superfluous to the Classic server. You won't lose anything if you don't install it. I recommend ignoring Guardian for the Classic server.

To launch an initial instance of Classic Server as an application, manually open a command prompt window, navigate to the bin directory, and type.

Installation/Configuration

The procedure described here for installing and configuring Firebird and InterBase is done once and allows you to use both of them:

    Install InterBase if it is not installed.

    Find all copies of the GDS32.DLL file on your computer and leave only one copy of it , making sure it is the same version as InterBase installed. Place it in the bin subdirectory of the directory where InterBase was installed. Typically this is C:\Program Files\Interbase corp\Interbase\bin or C:\Program Files\Borland\InterBase\bin .

    If you have not yet installed Firebird 1.5, please ensure the following:

    1. Important: If you have the pre-release Firebird installed, get the final release! If you cannot or do not want to do this, please read Appendix A first and then continue with the setup.

      Install Firebird 1.5 using the installer (i.e. run the downloaded .exe file). In the installer's "Select Additional Tasks" window, make sure the " Generate client library as GDS32.DLL».

      Copy the UDFs (User Defined Function Libraries) required by your database to the udf subdirectory of your Firebird installation directory.

    Check your "" folder (Start -> Programs -> Startup) to see if it contains shortcuts to launch InterBase or Firebird servers and their Guardians. If there are any such shortcuts, remove them.

    For Windows NT/2000/XP only : If the InterBase and/or Firebird servers are installed as services, then disable the automatic startup of the services themselves and the Guardians services. To do this use Windows Services Management(Windows Services Manager) or InterBase/Firebird Manager from Control Panels(Control Panel).

    Do not uninstall services yourself!

If you use IBX components in your applications and you have different application versions in different directories, then copy the InterBase version of GDS32.DLL into your IB application directories. If you cannot do this, you will need to always specify the computer name in the connection string when connecting to IB databases through IBX components. We don't know if other database access components have any problems (let alone how to solve them).

Switching between Interbase and Firebird

    If you have successfully completed the installation and configuration, you can start the InterBase or Firebird server of your choice. Be careful: they should not start at the same time. There are several ways to start and stop the database server:

    The easiest one, and therefore recommended: download the DBServerToggler program from the link.

    This small utility minimizes to the system tray when launched and does all the work for you. You can start and stop any of the servers by right-clicking on the utility icon in the system tray: if you start a server, DBServerToggler will first stop the other one if its service is running. You can choose how to run the server (as an application or as a service) for each server independently. Add " and you will always have this option. Another way. You can use InterBase and Firebird Managers from the Control Panel. Just don’t forget to stop the service of another before starting one server! If the server is installed as command written on one line and without hyphens/hyphens).

    Server Start/Stop via Guardian Start/stop directly
    InterBase net start/stop InterBaseGuardian net start/stop InterBaseServer
    Firebird 1.5 net start/stop FirebirdGuardianDefaultInstance net start/stop FirebirdServerDefaultInstance

    Comment

    If you are running InterBase versions prior to 5.6 via Guardian, you must run two commands net stop... to stop two services: first the Guardian and then the server. For InterBase version 6.0 and Firebird, stopping the Guardian service automatically stops the server.

    To run the server as applications you can use the following commands:

    Server Launch via Guardian Direct launch Stop
    InterBase ibguard -a ibserver -a
    Firebird 1.5 fbguard -a fbserver -a Via the system tray icon

    The executable files ibguard.exe/fbguard.exe and ibserver.exe/fbserver.exe are located in the bin subdirectory of the InterBase or Firebird installation directory.

The issues necessary for a developer to create client-server applications using the Firebird DBMS, which is a development of the Borland Interbase 6 DBMS, are considered. An overview of the concepts and models of client/server architecture is provided, as well as practical recommendations for working with Firebird client libraries. The features of SQL data types, the Data Manipulation Language (DML), and the syntax and operators of the Data Definition Language (DDL) are described in detail. Much attention is paid to the description of transactions and tips on their use in application development are given. Describes client- and server-side programming, writing triggers and stored procedures, creating and using database events, handling errors in server code, and much more. The material is accompanied by numerous examples, tips and practical recommendations.

For database developers

Book:

Sections on this page:

Classic POSIX server

Use the ps command in the Command Prompt to view running processes. If any clients are connected to a classic Firebird process, you should see one process named fb_netserver (or gds_inet_server for Firebird 1.0.x) for each connected client. The ps command has several switches, but the following option gives a suitable list. The grep command filters the output so that you only see Firebird processes.

$ ps -aux | grep fb

In Fig. 1.4 three client processes are running.


Rice. 1.4. List of classic processes obtained using ps

POSIX Superserver

Since Superserver forks threads per connection, it would be interesting to set the -f switch among other switches to display its processes and threads. You will get a formatted display of branched processes similar to the one shown in Fig. 1.5:

$ ps -auxf | grep fb

Rice. 1.5. List of Superserver processes and threads obtained using ps

The same ps command should display one process named fbguard (or ibguard) if the server was started with the -f switch, and one main process named fbserver (or ibserver). There must be at least one child thread named fbserver (or ibserver), split into multiple threads. This first group is the "running server" with no client connections except those the server uses to listen on ports and collect garbage. Next there will be a group of threads for each connection.

NOTE. The prefix "fb" refers to Firebird 1.5, and "gdb" and "ib" refer to Firebird 1.0.x. Use ps -aux | grep gds if you are running version 1.0.x.

Windows NT 4, 2000 and XP

For Windows server platforms, launch the Firebird Server Control applet from the Control Panel.

Server Control applet

In Fig. Figure 1.6 shows the Firebird Server Control applet running under Windows 2000 Server. If you used the installer, this applet will be installed in your Control Panel. Its appearance may vary depending on the Windows server version.


Rice. 1.6. Firebird Server Control Applet

You can use this applet to start and stop a service and to modify startup and execution modes. It is not recommended to change the mode to Run as an application for multi-user use for security reasons - you must remain connected to the server to keep the Firebird server running.

Applet Service

If you don't have the Control Panel applet, you can use the Services applet (Figure 1.7) in Administrative Tools. In Windows NT 4, you can access this applet directly through the Control Panel.


Rice. 1.7. Services applet on Windows server platforms

In Fig. 1.7 shows the names of Firebird 1.5 services for Guardian and server. Service names may differ depending on versions; Guardian may not appear in the list at all. A user with administrator privileges can right-click on a service name to stop or start the service. If you are using Guardian, stop this service to stop both Guardian and the server.

On Windows 2000 and Windows Server 2003, Guardian is more of a convenience than a necessity because these two operating systems have tools for viewing and restarting services. It is recommended to leave Guardian active on other platforms if the SYSDBA user is not available to manually restart the server in cases where it has been stopped for various reasons.

Other Control Panel applets

If you need the Firebird Manager applet and don't find it installed in your Windows server's Control Panel, or if you need the applet in a language other than English, download it from the Firebird website: http://www.ibphoenix.com. Close the Control Panel window and copy the CPL file directly to your Windows system directory.

Windows 9x, ME and XP Home Edition

Windows 9x, ME and XP Note Edition do not support services. The Firebird server must be run as an application controlled by the Guardian program. If you are using an installation kit that installs but does not automatically start Guardian and the Firebird server, you can do this manually, as shown below.

How to stop and start the Firebird server.

Before performing actions (copying, replacing, deleting, etc.) associated with the Client Shop database file (usually the file c:\TASK2.FDB if the file path has not been changed), you must first do the following:

Close all running Client Shop programs on your computer. If the program runs on a local network, you also need to close Client Shop programs on network computers.

Stop the Firebird server. If the Client Shop program runs on several computers on a local network, you need to stop the Firebird server on the main computer (accordingly, actions with the database are also performed on the main computer, since the file with the database is physically located there).

If you ignore these 2 actions, the effect can be similar to if you unplug the power cord while saving a file (for example, an Excel file). The original or copied database file may be damaged.

How to stop the Firebird server.

Start-->Control Panel-->Firebird Server Manager

If there is no “Firebird Server Manager” item in the Control Panel, in the upper right corner, instead of Viewing “category”, change to “Small icons”.

Go to Firebird Server Manager and stop the Firebird server.

Signs that Firebird Server is disabled:

In the upper left corner there is a black bird on a yellow background crossed out with a red cross, it says “The firebird service is not running”, to the right is a button with the inscription “Start”.

If you can't stop the Firebird server using the standard method

If the button to stop the Firebird server is not active (this happens on some computers), we use a different algorithm.

Firstly, if you need to stop the Firebird server in order to copy a database file, and you don’t have any other computers with the Client Shop program on your local network (that is, the Client Shop program is used only on one computer), you can simply restart the computer and BEFORE LAUNCHING THE Client Shop PROGRAM, perform the necessary manipulations with the TASK2.FDB files - although Firebird Server will be launched, it will still not be connected to the database, so you can copy it.

If you don’t want to restart your computer, method number 2:

Go to the folder with the installed Client Shop program (c:\Program Files\ClientShop2x or to another folder if the program is installed in a different folder).

Go to the Data2\System\UserUtils folder and find a program to stop and start the Firebird server. The program is in the archive, the password for unpacking the archive is 65536.

Using this program you can stop and start the Firebird server. If you cannot unpack the program directly on the spot, first copy it to another folder that is located outside the Windows and Program Files system folders (for example, on the desktop).

It should be noted that in new versions of the Client Shop program, starting from version 3.20, it is not necessary to manually go into the ClientShop2x directory - to stop the Firebird server, you can use the script "Start-->Programs-->ClientShop-->Stopping and starting the Firebird server", which a little more convenient.

How to start a Firebird server.

The actions are the same as stopping the server, you just need to start it.

In general, it is not necessary to launch it - if the server is not running, the Client Shop program will launch it itself.

Firebird

Important! If you have previously installed the InterBase database server, then it must be removed (uninstalled), otherwise the normal operation of the Firebird database server will be difficult. This can be done using the Add or Remove Programs utility in the Control Panel (usually located in the My Computer folder). If you have Windows XP SP2 or an earlier version installed, we strongly recommend upgrading to Service Pack 3 (SP3).

1) Download the Firebird server distribution kit from the following site, as well as all the necessary instructions: http://*****/category/programs_for_mlm.

2) If you are installing on the Windows Vista or Windows 7 operating system, then click on the distribution package “Firebird_25.exe” (the name of the file with the distribution package may differ depending on the version) with the right mouse button and in the drop-down menu select “Run as administrator” ", then confirm to run as administrator if User Account Control prompts you to do so. On Windows XP, Windows 2000 and lower versions of Windows, simply double-click on the distribution file “Firebird_25.exe”.

Important! The Firebird database server in Windows Vista or Windows 7 operating systems must be installed as an administrator!

3) In the window that appears, select the language that will be used during the installation process (the default is “Russian”) and click on the “OK” button:


https://pandia.ru/text/78/399/images/image002_57.jpg" width="503" height="385 src=">

5) Place a dot opposite the inscription “I accept the terms of the agreement”:

https://pandia.ru/text/78/399/images/image004_30.jpg" width="503" height="385 src=">

https://pandia.ru/text/78/399/images/image006_18.jpg" width="504" height="385 src=">

https://pandia.ru/text/78/399/images/image008_11.jpg" width="504" height="385 src=">

11) Uncheck opposite “Use Guardian to manage the server.” Check the boxes opposite “Run as an Application” if you are installing the program on the Windows XP, Windows 2000 or lower versions of Windows, or opposite “Run as a Service” if you are installing the program on the Windows Vista or Windows 7 operating system. Check the boxes opposite “Automatically start Firebird on every boot”, “Copy the Firebird client library to the directory " and "Create GDS32.DLL to support legacy applications." Check the boxes opposite “Install Control Panel Applet” if you are installing the program on the operating system Windows XP, Windows 2000 or lower versions of Windows. In Windows Vista and Windows 7 operating systems, this checkbox does not need to be checked!

https://pandia.ru/text/78/399/images/image010_9.jpg" width="504" height="385 src=">

13) Wait while the installer installs the Firebird server on your computer:

https://pandia.ru/text/78/399/images/image012_9.jpg" width="504" height="385 src=">

15) Click on the “Finish” button:

https://pandia.ru/text/78/399/images/image014_5.jpg" width="589 height=442" height="442">

The following window should appear on the screen:

Rice. 1 Rice. 2

If you see a picture on the screen like this Rice. 1(at the top, next to the logo, the inscription “The Firebird service is running”), then the Firebird database server is running. If you see a picture on the screen like in Rice. 2(the logo is crossed out with a red cross, and next to it is the inscription “The Firebird service is not running”), then the Firebird database server is stopped and needs to be started, to do this, click on the “Start” button in the upper left corner of the window.

Make sure that in the “Start” field the dot is near the inscription “Automatically”. If it is next to the “Manually” inscription, then click on the “Automatically” inscription and click on the “Apply” button - this way the server will start automatically when the computer boots.

You can manage the Firebird database server (start, stop, etc.) in Windows Vista or Windows 7 only through service management. To do this, click on the “Start” button (the button on the task manager or the keyboard key with the MicroSoft logo):

Then right-click on “Computer” and select “Manage” from the drop-down menu.

The following window will open:

Double-click Services and Applications, then Services.

Find the Firebird Server service in the list of services:

If the service status is “Running,” then the Firebird database server is running, but if there is no status in the “Status” cell (it is empty), then it must be started. To do this, right-click on the “Firebird Server” service name and select “Run” from the drop-down menu.