Databases

<< Administration tools | Firebird SQL Server 2.x Administration Handbook | Database configuration >>

Databases

A database consists of a file (distribution across several files is possible). This file contains all tables, indices, user rights (Grants), foreign keys, stored procedures, triggers, etc.

Usual suffix: .fdb

This file must be stored on the same computer as the Firebird service itself. Access to a file server is technically impossible (regardless of whether via UNC names or a hard drive letter).

A database file will always get bigger, never smaller. The only possibility to reduce the size of a database file, is to performa a backup and restore.

Database string

In order to connect to a certain Firebird database, the client must enter the database string. This is composed of the following:

 <servername> [/<port>] ":" <datenbank>
servernameName of the database server in the TCP/IP network.
portPort number or IP service name, if the standard port 3050 is not to be used (see also firebird.conf).
datenbankEither the file name of the database. Important: This name must always be entered from the viewpoint of the database server's local file system (no clearance directory names or similar). The directory in which the database is stored must not require clearance in order to use it.
or
The name of the database alias, as defined in aliases.conf.

The DatabaseAccess parameter in firebird.conf determines whether file names, aliases or both may be used.

The rules regarding case sensitivity conform to the server operating system. On a Linux server case sensitivity needs to be taken in consideration, on Windows it doesn't.

Example Windows server

The database server name is dbserver. The default port is used. The database file is stored on C:\DB\pmm.fdb:

 dbserver:C:\DB\pmm.fdb

Example Linux server

The database server name is dbserver. The default port is used. The database file is stored on /db/pmm.fdb:

 dbserver:/db/pmm.fdb

Example port number 3051

The database server name is dbserver. Port 3051 is to be used. The database file is stored on C:\DB\pmm.fdb:

 dbserver/3051:C:\DB\pmm.fdb

If the port number is to a service name in the services file:

 firebirdsql 3051/tcp

then the service name can be used instead of the port number:

 dbserver/firebirdsql:C:\DB\pmm.fdb

See also:
Configuring Firebird

back to top of page

Alias names

Entering the full database connection string with directory and file name is cumbersome and a potential security risk. For this reasons alias names can be defined on the server.

These can be defined in the aliases.conf file.

Here you can find alias specifications:

 <aliasname> = <pfad- und dateiname>

Example

The database server name is dbserver. The default port is used. The database file is stored on /db/pmm.fdb, an alias name pmm is to be specified for the database.

aliases.conf definition:

 pmm = /db/pmm.fdb

The database connection string is now:

 dbserver:pmm

A combination with the syntax for port number or service name specification is also possible:

 dbserver/3051:pmm

See also:
Configuring Firebird

back to top of page

Owner, permissions

The database "owner" is the user that created the database (i.e. executed the CREATE DATABASE command). He kann grant permissions (read, write, execute) to other users (GRANT). If he does not GRANT any other users permissions, only the owner can perform DDL und DML operations.

In addition the SYSDBA user always has all permissions on all databases.

Only the SYSDBA or database owner can perform a backup or replace an existing database by a restore.

back to top of page
<< Administration tools | Firebird SQL Server 2.x Administration Handbook | Database configuration >>