Subject RE: [firebird-support] Examples/ideas on scripts for nightly backups/restores?
Author Alan McDonald
> I want to make sure that my backup scripts are correct, so I am
> looking for some examples...
>
> Right now I perform the following:
>
> gbak -backup to a temp file in a /backup directory
> if exit code ok
> gbak -create to restore to a /temp directory
> if exit code ok
> stop firebird service
> move good restore into /production directory
> rename as original database name
> start firebird service
> gzip original temp backup file in /backup dir
>
> My questions... is there a better way to do this?
>
> Instead of shutting down the firebird service... should I use gfix -sh
> instead like this:
>
> gfix -sh -f 600 database
> move good restore into /production directory
> rename as original database name
> gfix -online database
>
> Many thanks,
> --Raymond

You have to be carefull here...
1. if the db is large then time to backup then restore will leave live
action in the db while this is going on, and you'll loose it.
2. shutdown will only work if normal users are NEVER SYSDBA or the DB OWNER,
in which case your applications using these identities will also be able to
ignore shutdown.

My maintenance amounts to frequent backups and test restores to alternative
named dbs but the once yearly restore to the production environment is
manual in this order:
1. shut down server
2. rename production db to another name
3. start server again (noone can connect)
4. backup it up
5. restore it to the non-production name (noone can connect while you are
restoring)
6. if all successful - stop server again
7. rename to production
8. start server.
You're back in action

If your environment does not allow this i.e. if production must be online
all the time - no interruptions ever, then restoring is not possible to
production.

Alan