Tuesday, June 07, 2016

Mess of gbak options

I see lot of places where gbak options (Firebird, InterBase) specified randomly.
Examples:
gbak -c -r

what do you mean? -c or -r? Documentation specifies -c | -r. Symbol "|" is OR, not AND. Moreover, -r is not restore, it's REPLACE!
Thanks god, Firebird 1.5 and higher disabled -r option, because it allow to drop original database file without warning. Now you must specify -rep or -r o. Anyway, both of these is useless, because -c is enough. If you write script, rename original file before gbak -c. If something went wrong, you will have original DB file safe.

gbak -t ...
Come on, -t is default option for transportable backup. You think that someone will change it later to non-default? I doubt so.


gbak -c ... -page_size ...
don't incude this to regular script. Page size change usually made once, by administrative decision. If you specify this option in the script, and there is 4096 specified, after changing page size to 8192 and regular restore you will get 4096 again. Leave -page_size option to manual change.

gbak -b ... -ig ...
Ignoring checksum errors is useful only when database is corrupted. If you include this option to regular script, you may not find that database is broken.

p.s.
45 Ways To Speed Up Firebird Database
12 Common Mistakes while Backing Up Databases
HQbird: advanced Firebird SQL for Enterprises