Subject RE: [firebird-support] script to recreate database
Author Yusuf Celik
1) gbak -b -v -user SYSDBA -pas masterkey fdb.FDB fdb.bkp -y fdb.log
if ERRORLEVEL 1 goto error
2) gbak -r -v -user SYSDBA -pas masterkey fdb.bkp -y Log.log

if ERRORLEVEL 1 goto error
3) No idea
4) del fdb.FDB
5) ren fdb.fdb
6)No idea


[] On Behalf Of Puigsegur, Jordi
Sent: Friday, July 06, 2007 4:27 PM
Subject: [firebird-support] script to recreate database

Hi all,

We have a database that under certain circumstances has a lot of free
space due to massive deletions and we would like to be able to recreate
it using gbak so that it occupies less space.

Does anyone have a script (FB 2.0 / Windows 2003 Server) that does the

1) create a backup of the database using gbak
2) restore the backup using gbak on using a new filename (the current
database stays online)
3) shutdown the online database
4) delete old database file
5) rename new database file to correct database filename
6) put the new database online

The idea would be to minimize the downtime. Since the database is big
(two or three Gigs minimum) we cannot replace the database while doing
the restore with the gbak.


[Non-text portions of this message have been removed]