logo

Maintaining Firebird Database

Firebird DBMS that can be used in ELMA, starts operating slower over time, due to its internal structure: the database accumulates many excessive data, which negatively affects the database performance and size. Therefore, ELMA system working under Firebird becomes slower over time.

Unfortunately, Firebird DBMS is an external system and we cannot affect its architecture. However, there is a solution, that allows restoring its operation speed, by clearing the database off of excessive data. For this, you need to back up and recover the database from time to time.

You can perform this procedure manually, using commands of the DBMS utilities. We suggest that you use a bat file for automating these operations.

Backing up Firebird database and recovering
Follow this link http://www.firebirdsql.org/manual/ru/nbackup-backups-ru.html to learn more about backing up and recovering Firebird databases

Preparing a Bat file

Bat file is attached to the article (bd_backup.bat), upload it to the server with ELMA and place it to the folder ~\ELMA3\FirebirdServer\bin

If you use a Firebird DBMS not included in the standard ELMA package, place this file into the respective bin folder of your DBMS. Make sure, that this folder also contains the file gbak.exe

Before launching the file, you need to customize it. Open the file for editing (e.g. in the notepad): 

  • In the line setFULL_PATH=C:\ELMA3-Express\UserConfig\ type the full path to the directory with ELMA database
  • In the line setCOPY_PATH=C:\ELMA3-Express\FirebirdServer\Arch\ type the full path to the directory, which will store database backup copies. Specify an existing directory. It is recommended that you use a directory located on another drive (not the one, where the system database is installed).

Save the file.

Using the Bat file

Before using the bat file, stop ELMA server. No users must be connected to the database.

Run the bat file. The operation may take a while, wait until it is complete.

If the backup copying completed successfully, the database file, used by ELMA, will be replaced with the recovered one. You can find the backup copy of the old database version in the directory, specified in the COPY_PATH variable of the bat-file (by default, C:\ELMA3-Express\FirebirdServer\Arch). The backup copy file includes the date of procedure in its name. During the database backup-recovery, the backup copy file will be overwritten.

 

It is recommended that you perform this procedure once every two weeks, if ELMA is used actively

Attachments