Subject Re: [firebird-support] HELP! Unavailable database whatever I do!
Author Artur Anjos
David,

> I left a test running over the weekend, and unexpectantly ran out of space
> on my hard drive.

Do you remember if you have force writes on or off?

> this apparently has left Firebird in a very bad way...I get an
"unavailable
> database" **whatever** I do - especially wierd that I get it while trying
> to create a new database too!!

It seems that you left it off. This way Firebird told the Operating System
to write the data, and the Operating system returned 'ok, it was saved'.
There's no way to Firebird to detect such cases, and you will end with a
damage database.

I never tested this kind of situations, so this is the time. :-)

I just picked up a disquete to a small test. I have create a database in
drive A, with Force Writes On. I'm using Firebird 1 on W2K. The initial file
was 581.632 bytes. (I wasn't expecting to be abble to create a database in a
removable drive, but I was. Great!).

create table Test ( Name VARCHAR(1024) );
And start filling it up....

Something to think about it: I'm filling it up with lots of insert's without
commiting, and each time I do such a bulk insert my drive doesn't run ->
Firebird or Windows are caching the data.
Commit -> Drive makes some noise, file size increases.

And it happens. Windows is telling me 'I/O error for file A:\testeme.fbd'. a
rollback was sucessfull. Disconnect, connect again, browse the data. All ok.
Try to insert. Ok. Commit. Same error.
Took a look at Firebird log: nothing there reporting the error.
No errors reported in Windows Events.

Let's change the Force Writes to Off....
It fails. Rollback. Ok. Try to insert. ok. Commit. Ops. This time I've got
an extra message: 'internal gds software consistency check (error during
savepoint backout(290))'.
And now I've got a broken database. Something to be expected.

Well my test was made in a different drive that I'm running Firebird from
(it runs from drive C). I'm abble to create new databases in other drives.
It's possible that when you run out of space other Fb files got broken. A
shot in the dark: search in your firebird directorys for a file named
YourComputerNetworkName.lck. Stop the firebird server and delete this file.
Start it again. Maybe is something miss up there.

I hope this helps.

Artur