Creating and Removing a Database

Creating a Database

To create a database you must use the mkdbase command.

Databases may be of two types:

A newly created database is locked to all users except the owner and, on UNIX, the super-user. The database must be configured (see Reality Configuration on the Host) before it can be unlocked (see Locking and Unlocking a Database).

Note

On Windows 7 and Server 2008, databases that will be available on the network must be created in a folder with unrestricted access, such as a dedicated subfolder within the root folder. A database in a user's home folder cannot be accessed remotely.

Partition Database (single filesystem)

To create a partition database on a single file system, enter:

mkdbase -N databaseName -Ssize{files} {databasePath}

where databaseName is the network name that you will use to connect to the database, and databasePath is the path to the directory that will hold the database files.

The size of the database is specified by the size parameter - you can specify size in Megabytes or Gigabytes by using the appropriate suffix (M or G respectively). files specifies the number of files used (default 10). For example, to create a 20Gbyte database called dbase1 in the current directory, enter:

mkdbase -N dbase1 -S20G

The database will consist of ten 2Gbyte files.

Note

Choose the number of files carefully - you enlarge this type of database by adding more files that are the same size as the existing ones.

This type of database is the default. If you omit the -S option and there is no corresponding entry in realfstab (see below), a partition database is created consisting of a single host file with 20000 frames (see Frame Size).

Partition Database (multiple filesystems or partitions)

To create a partition database using disk partitions or files on different file systems, add an entry to the realfstab file listing the partitions or files (as appropriate) assigned to the database. Then enter:

mkdbase -N realfstabEntry

where realfstabEntry is the name of the entry in the realfstab file. For example, having created a realfstab entry called dbase1, create the database by entering:

mkdbase -N dbase1

The database's base directory will be created in the current directory.

Filestore Database (UNIX only)

To create a filestore database, enter:

mkdbase -U -N databaseName {databasePath}

where databaseName is the network name that you will use to connect to the database, and databasePath is the path to the directory that will hold the database files. If you omit databasePath, a sub-directory with the same name as the database is created in the current directory. For example, to create a filestore database called dbase1 in the current directory, enter:

mkdbase -U -N dbase1

Enlarging a Database

Partition Database (single filesystem)

A partition database on a single filesystem can be enlarged by adding files. Enter:

mkdbase -N databaseName -A files

where databaseName is the name of the database and files is the number of files to add. The files will be the same size as the existing ones - this depends on the size of the original database and number of files used (see Making a Database).

Partition Database (multiple filesystems or partitions)

There are two ways of enlarging a partition database that uses disk partitions or files on different file systems:

Filestore Database (UNIX only)

A filestore database expands and contracts automatically as you use the database.

Rebuilding a Database

In some circumstances it may be desirable to rebuild an existing database. This can be done using mkdbase with the -r option.

Caution

When you rebuild a database, the top database directory and the config file are retained, but the rest of the database is removed and rebuilt. Any user data in the existing database which you wish to keep must be saved, and restored on the re-constructed database.

Removing a Database

To remove a database you must use the rmdbase host command.

Caution

When rmdbase is executed, the database is permanently removed from the system. It cannot be recovered, other than from a back-up. Before removing a database, ensure that any data that must be retained has been backed up.