Subject Re: [firebird-support] Database was emptied no data in the tables - how this can happen ?
Author Helen Borrie
At 03:57 PM 24/06/2010, you wrote:
>We had several cases where information in database was deleted and we where left with all the tables empty. the database file size however seems correct. The deletion was not done by us.
>We use firebird 2.0.3 on Windows XP
>1. Is it possible that during backup - restore using gbak that we perform every night data will be lost ?

You need to tell us whether you use the [dangerous] -replace_database switch is used.

>2. When restoring is interrupted the database is left in such empty state ?

If you use -replace_database, your database file is DELETED before the restore begins.

>if so why restoring is not like a transaction that unless successful the database will be left unchanged.

Because restore does not **update** your database, it destroys it (with the -replace_database option) before creating a new one. The RECOMMENDED -create_database option also creates a new database. It won't work if you do not specify either a different location or a different name for the new database.

Within the restore, gbak code does use transactions, inside the *new* database.

>3. During backup is it possible that the database will be changed (no access is performed during backup)

Yes. Backup works in its own transaction. Any changes that occur after the backup starts will not be in the backup.

>4. Can a corrupted backup be restored ?


>Is there a way to restore the database to it original state ?

Depends on what you mean by "original state".