You are currently browsing articles tagged firebird.

I added some code to track down where FBClone spends most of it’s time.

You can download FBClone v1.5 and try with the verbose option, it will log tons of funny things on the console so you will not have to go for a beer 🙂

If you see something interresting, please send my your output log by email (pierre at levosgien dotnet)

Thank you for your help !

Tags: , , ,

Repairing broken Firebird database can be sometimes a bit difficult. The official tools (gfix and gbak) not always can help you so you will have to find ways to transfer data from broken database into another fresh and clean one.

There are some tools that can help you :

  • IB Datapump that is a bit old an not very fine tuned to access broken databases

  • FB Copy that lacks options to access broken databases too.

If your database is heavily broken, you will have to fire out the heavy artillery and buy some commercial products like IBFirstAid.

This incredible piece of software will walk throught your database, finding errors and inconsistencies, fix them so you will, probably be able to access your databasa again with gfix and gbak.

I’ve written my own database cloning tool for Firebird. It’s named FBClone, it’s written with Delphi and uses the wonderful UIB Components from Progdigy.

Features :

  • Clone a whole database like a backup (gbak -b) and a restore (gbak -c) in a single pass

  • Pump data from a source database into another one with the same structure. A database with the same structure can be created with gbak using the option ”-m” to restore metadata only.

  • Change database and data charset, converting an old Firebird 1.5 ISO8859_1 database into a fresh new Firebird 2.1 UTF8 one.

You can download FBClone 1.4 Source and Windows Executable.

[Edit] Updated FBClone to v1.4
ChangeLog :

  • Support Firebird 2.1+

  • Improved output

  • Allow to change target database page size (example : -ps 8192)

  • English is the default language for the application now.

[Edit] The code is shared under the IDPL – Initial Developer Public License – Thank you for sharing your modifications.

Tags: , ,

I wrote a little batch script to switch between versions of Firebird SQL Server nearly automatically. Read the rest of this entry »

Tags: ,

SSH is a wonderful piece of software. I found (hum, Philippe, the CentOS package maintainer, president of the Firebird Foundation and member of the QA team of Firebird helped me to find) how to create a SSH tunnel through I can run a distant Firebird backup.

This is the standard gbak command :

$ gbak -b [-v] XXX.XXX.XXX.XXX:database backup.fbk -user SYSDBA -password masterkey

With that command you can create a LOCAL backup of a REMOTE database.

With this command :

$ gbak -b [-v] -service XXX.XXX.XXX.XXX:service_mgr database /path/to/backup.fbk -user SYSDBA -password masterkey

You will create a REMOTE backup (in /path/to/backup.fbk) of a REMOTE database.

Now, how can I create a LOCAL backup for a REMOTE database with stream compression and encryption ? By using SSH Tunnelling.

$ ssh -C -f user@XXX.XXX.XXX.XXX -L 3052:localhost:3050 -N

This will run a background (-f) SSH Tunnel (-L) mapping local port 3052 to remote port 3050 (3052:localhost:3050) with compression (-C, or -o Compression=yes) and without running a remote command (-N)

Now we can use this tunnel to start a secured/compressed remote backup :

$ gbak -b [-v] localhost/3052:database backup.fbk -user SYSDBA password masterkey

Note : “database” can be an alias name, if defined in /etc/firebird/aliases.conf (location depends on your distribution package maintainer, at least this is where I can find this file on CentOS 5.3 using EPEL Testing repository) or the full path of the database on the host system. “backup.fbk” is the local path of the backup file.

You will restore this backup locally by using this command :

$ gbak -c [-v] backup.fbk database -user SYSDBA -password masterkey

Of course, you will have to adjust the user/password depending on your own configuration.

Tags: , , , , ,

This is my first released backup script for Firebird RDBMS. It automagically search for all Firebird databases from a central directory, uses gfix to validate them, then backup + gzip them to a central backup directory keeping only 5 last successful backups.

It may be used as a cron script to automate Firebird databases backup. Read the rest of this entry »

Tags: , , ,