Subject Re: [firebird-support] insert data two databases different
Author Helen Borrie
Joel Moo wrote:

> Hi guys, i have a situation, I work with a database name database1.fdb,
> and so, i do maintanance over this databases weekly.

> I backup this database before maintenance, but the maintenance failed,
> so the .fdb file in which the maintenance failed will rename it to
> database_2, and then restore the database1.fdb file.
> 2 days later for some reason the information was inserted in database
> database_2 and not in database1.fdb. It is worth mentioning that these
> files and the database.config were not modified again

> Any advice or experience with a similar situation?

Well, first of all, there is no way that the Firebird engine can
perform any operation on a database to which it is not connected. If
your application seems to have updated database_2 then, some
unplanned things occurred.

The best guess (from the information you have given) is that
the renaming of the original copy of database1.fdb to database_2 did
not happen.

How could that be? Well, if you ask the operating system to
rename a file that is open, it will not work. A database file is open
if any application is connected to it. Your script has not
picked up that error condition so it continued onward, with the original
database1.fdb still named "database1.fdb". So, the restore from the
backup also failed, since gbak restore will not overwrite an existing
database file of the same name unless you specify OVERWRITE explicitly
with the -r[ecreate_database] switch.

Meanwhile, at some point during thos two days, after someone had
inserted some data into database1.fdb, someone else came along and
renamed the database to database_2. Gremlins, maybe?


This email has been checked for viruses by AVG.