Subject script to recreate database
Author Puigsegur, Jordi
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.