Subject | Re[2]: [firebird-support] Can not restore a database |
---|---|
Author | Alexander Tabakov |
Post date | 2005-08-02T07:09:03Z |
First of all thank you for the replies.
Now that everything is back to normal I will describe the case in more
details, so maybe someone will give me additional information about the
cause of the problem.
We have a production database (I will call it the database), running
on FB 1.5.2, Windows 2000, about 2GB in size. The database is being gbak-ed
each night. The problem started when I tried to restore the GBK file.
As already metioned I received the following message:
gbak: ERROR: invalid request BLR at offset 6
gbak: ERROR: table id 323 is not defined
gbak: Exiting before completion due to errors
Ignoring the message I did connect to the restored database. The good
news is that all data was there, but there were no triggers, stored
procedure and views.
Looking in the original database I did find that table with ID 323 is
TBL_HOST. As Ann supposed there was no such relation Id in the
restored database but TBL_HOST was still present in RDB$RELATION.
After all I did find the problem. A table (TBL_HOST_CODE) had a foreing
key on TBL_HOST, and trying to select data from TBL_HOST_CODE gave the
same error message as above.
The resolution:
1. Drop TBL_HOST
2. Backup
3. Restore
4. Add TBL_HOST
5. Backup
6. Restore
So now everything is OK.
Now, I have some questions:
1) Why after all the original database was OK. There was no problem
with it. I did run "gfix -v -full" on the database and it gave me no
errors.
2) After all what can be te reason that when restoring TBL_HOST_CODE
still refers the old Id (323) instead of the newly created one?
Thanks in advance
--
Best regards,
Alexander mailto:saho@...
Now that everything is back to normal I will describe the case in more
details, so maybe someone will give me additional information about the
cause of the problem.
We have a production database (I will call it the database), running
on FB 1.5.2, Windows 2000, about 2GB in size. The database is being gbak-ed
each night. The problem started when I tried to restore the GBK file.
As already metioned I received the following message:
gbak: ERROR: invalid request BLR at offset 6
gbak: ERROR: table id 323 is not defined
gbak: Exiting before completion due to errors
Ignoring the message I did connect to the restored database. The good
news is that all data was there, but there were no triggers, stored
procedure and views.
Looking in the original database I did find that table with ID 323 is
TBL_HOST. As Ann supposed there was no such relation Id in the
restored database but TBL_HOST was still present in RDB$RELATION.
After all I did find the problem. A table (TBL_HOST_CODE) had a foreing
key on TBL_HOST, and trying to select data from TBL_HOST_CODE gave the
same error message as above.
The resolution:
1. Drop TBL_HOST
2. Backup
3. Restore
4. Add TBL_HOST
5. Backup
6. Restore
So now everything is OK.
Now, I have some questions:
1) Why after all the original database was OK. There was no problem
with it. I did run "gfix -v -full" on the database and it gave me no
errors.
2) After all what can be te reason that when restoring TBL_HOST_CODE
still refers the old Id (323) instead of the newly created one?
Thanks in advance
--
Best regards,
Alexander mailto:saho@...