Firebird Documentation IndexIsql - Interactive SQL → Creating A Database
Firebird Home Firebird Home Prev: Connecting To A DatabaseFirebird Documentation IndexUp: Isql - Interactive SQLNext: Setting The ISC_USER And ISC_PASSWORD Environment Variables

Creating A Database

To create a database interactively using the isql command shell, get to a command prompt in Firebird's bin subdirectory and type isql (Windows) or ./isql (Linux):

C:\Program Files\Firebird\Firebird_2_0\bin>isql
Use CONNECT or CREATE DATABASE to specify a database

To create a database named monkey.fdb and store it in a directory named test on your C drive:

SQL>CREATE DATABASE 'C:\test\monkey.fdb' page_size 8192
CON>user 'SYSDBA' password 'masterkey';

Note

In the CREATE DATABASE statement it is mandatory to place quote characters (single or double) around path, user name and password.

When running Classic Server on Linux, if the database is not started with a host name, the database file will be created with the Linux login name as the owner. This may cause access rights to others who may want to connect at a later stage. By prepending the localhost: to the path, the server process, with Firebird 2.0 running as user firebird, will create and own the file.

To test the newly created database type:

SQL>SELECT RDB$RELATION_ID FROM RDB$DATABASE;

RDB$RELATION_ID
===============
128

SQL> commit;

To get back to the command prompt type quit or exit.

Note

The above technique, as demonstrated, works, but ideally databases and meta data objects should be created and maintained using data definition scripts.

Prev: Connecting To A DatabaseFirebird Documentation IndexUp: Isql - Interactive SQLNext: Setting The ISC_USER And ISC_PASSWORD Environment Variables
Firebird Documentation IndexIsql - Interactive SQL → Creating A Database