Subject Re: [firebird-support] Re: Locking a database to cause a backup to fail
Author Helen Borrie
>--- In, "Steve Harp" <steve@...> wrote:
> >
> > Hi Guys,
> >
> > Is there a way to lock a database to force a backup will fail?
> >
> > Why would anyone want to do this you ask? Well, my boss is trying to
> > test an application and wants to see the response when a backup fails.
> >
> > Thanks,
> > Steve
> >

At 11:03 AM 30/04/2006, Adam wrote:

>Lots of ways.

Umm, no.

>Add a not null field to a table with existing data and do not fill the
>pre-existing records with values is the easiest guaranteed method I
>have seen.

That will break a restore, but not a backup.

>Playing around yourself with system tables is also pretty reliable, as
>is connecting to a database before a restore is complete or switching
>forced writes off and hard powering down during an operation.

Or just deleting the database file and then trying to back it up. ;-)

What Steve seems to be asking for is to simulate a scenario where a
gbak -b process would fall over once it had started, not simulating a
restore from a backup of a corrupt database.

The only idea I can think of would be to start a backup where you
were writing to a backup file on a remote filesystem and then
unplugging the network cable from the remote machine. Or you could
have some fun with a USB key or a memory card as the destination for
the backup file and yanking the device out while the backup was running...