Firebird embedded – Linux (update)

In this post I explained how to set up an embedded Firebird version for Linux.A few weeks ago I read a post from Olivier Mascia that explained a simpler way: instead of starting the program using a script that sets up a couple of environment variables, just callsetenv() to set those variables in the program.

There are many good articles in the archives about firebird and creating an accounting program with open source tools.

Procedure to rebuild all indexes

After reading news about rebuilding Firebird indexes, I wrote a procedure for Windows, which allows fully automatic rebuild all indexes in the Firebird database. The procedure is described on my website http://gskoczylas.rekord.pl/Firebird/AutoReindexAll.php (in Polish). Automatic translation into English is here: http://goo.gl/9Uu96.

At the end of the web page there is a link which allows to download the complete procedure. Procedure has been tested on Windows Vista with Firebird 2.5.


Regards,

Grzegorz Skoczylas
gskoczylas@gmail.com

Rebuilding a Firebird index

After looking at Damyan Ivanov posix script to rebuild indexes, I saw that he was using an undocumented “implementation artifact” (thanks to Dmitry Yemanov for confirming this) to rebuild indexes (including PK and FKs indexes). What he does is to call ALTER INDEX xxxx ACTIVE, where xxxx is an already active index!

Beside the fact that trying to activate an already active  index sounds “weird”, this will make Firebird to rebuild the index. Seems to be an easy way to rebuild PK/FK/UNIQs indexes (since they cannot be deactivated).

BTW, Damyan’s script will rebuild all indexes containing “text” fields in their keys. He created the script for the case where a previously created database needs to be run in a Firebird compiled with different version of the ICU libraries.

Migrating users from FB 2.1 to FB 2.5

People moving to FB 2.5.0 may be asking if it is safe to copy the security2.fdb file from previous versions of Firebird to Firebird 2.5, keeping the users previously created, so avoiding to recreate them.

In theory, copying the file should work, but with no guarantees. Firebird 2.5 uses a new ODS (11.2). You can do a backup/restore in FB 2.5 to update the ODS of security2.fdb, but some problems will still persists, regarding the use of the new role RDB$ADMIN (which gives SYSDBA rights to “normal” users) – in this case, normal users who were granted RDB$ADMIN role, will have problems to use the new SQL commands CREATE/ALTER/DROP USER. Note: Firebird 2.5.1 will bring a sql script to fix this problem.

So, the safest way to move users to FB 2.5 right now, is to recreate them in Firebird 2.5, either using gsec.exe or the new CREATE USER statement.

Thanks to Dmitry Yemanov for detailed information about the problem.

1 24 25 26 27 28 78