FirebirdSQL
618 subscribers
16 photos
243 links
Channel for Firebird SQL users and developers
Download Telegram
Firebird Friday Joke #9 - How to execute SQL query with isql in command prompt.
https://ib-aid.com/en/articles/how-to-execute-sql-command-with-isql-in-command-prompt/
Channel photo updated
Hello All! Today will be no joke - we are working on very serious thing - new version of the collection of optimized configuration files for Firebird. to be released next week. Stay tuned!
Firebird Friday Joke #12
Hello All and good Friday for everyone! Hope everybody is well, and not infected neither by coronavirus nor by panic about it :)
Today we have an evil joke (dark times! dark jokes!) - how to inflate Firebird database with temporary blobs with speed 2-3Gb per minute (on SSD). Of course, just an example, don't run it on production databases!
Details and very evil sample code: https://ib-aid.com/en/articles/how-to-inflate-firebird-database-with-temporary-blobs/
Should we cancel Firebird Conference (preliminary is around October) in this year due to coronavirus? It was not announced yet, of course, just want your advice.
Anonymous Poll
32%
Cancel Conference
68%
No, let's do it!
Annual General Meeting of Firebird Foundation started today - there will be elections of FF Committee and President of FF.
Firebird Friday Joke #13
Todays's joke is devoted to the method how to speed up backup and restore from/to network server to the client machine with gbak using Services API.

In essence:

fbsvcmgr remotehost:service_mgr -user sysdba -password XXX \
action_backup -dbname some.fdb -bkp_file stdout >some.fbk

and to restore it:
fbsvcmgr remotehost:service_mgr -user sysdba -password XXX \
action_restore -dbname some.fdb -bkp_file stdin <some.fbk

Details are described in the document README.services_extension, #4 in the folder doc of your Firebird installation.
Just received very interesting case of data loss, related with the loss of database file due to phantom file problem on Linux.
In essence, administrator deleted old database file, when it had active connections - as a result, Firebird keeps the handle of deleted file and retains it from the actual deleting.
Then, administrator restored database under the same name, and enabled users to work. Obviously, new entered data went not to the new (visible) file, but to the deleted, because Firebird SuperServer retained the connection.
Such phantom file exists till the disconnect of the last Firebird user. Database worked several days in this state, but eventually all clients disconnected and Firebird server released the old deleted file.
After disconnect and reconnect, all data since restore were missing.
Classic case of using evil switch -rep in gbak? Of course, without backups?
Yes, but it has additional flavour: administrator did backup of the virtual machine each 4 hours, and was absolutely sure that it contains more or less actual version of the database file!
However, restored image does not contain deleted phantom file...
Conclusion: use true database backup for the databases, VM backup is for hipsters and marketing managers :)
Continuing the story - VM backup was mounted in read-only mode and then the administrator used file undelete software. As a result, the database file was extracted from the image. It is corrupted (often case for VM backups and especially for deleted file), but FirstAID was able to extract corrupted data and merge them into the database file, so losses of data are minimized. Pretty good outcome of the very bad case!
nbackup with switch -D ON does not work on ZFS on Linux. More details here: https://ib-aid.com/en/articles/nbackup-with-switch-d-on-does-not-work-on-zfs/
Firebird Friday Joke #14

Today's joke is devoted to inserts, specifically - how to insert millions of different test records as fast as possible.
In the code example below, we can insert 1mln records in 5.6 seconds:

https://ib-aid.com/en/articles/how-to-quickly-fill-table-in-firebird-with-millions-of-records/
Please take a look at FirebirdSQL website at mobile phone
http://www.firebirdtest.com/
and provide some feedback to mail group firebird-website@lists.sourceforge.net
It is unbelievable how our world is tightly connected nowadays. Watching all these videos about disease and panic from China and Italy, I did not realize that Firebird technology can be somehow involved in it... However, one of the popular DNA sequencers models has the software backed by Firebird database and one of these databases from Chinese hospital which is directly involved in COVID investigations, was corrupted. It uses Firebird 1.5, old version, of course, but DNA device also was designed several years ago. They contacted us this morning, we started recovery immediately and were able to save available data. Now awaiting the feedback from the scientists. I hope it will help a bit...