Subject | Re: [firebird-support] gbak restore suddenly stops working |
---|---|
Author | Helen Borrie |
Post date | 2006-04-04T14:41:41Z |
At 10:45 PM 4/04/2006, you wrote:
database name that already exists in the folder that you are
restoring to. You should use a different file name for the new
database, e.g. company_restored.fdb.
Here it's a case of your being protected by not understanding
that. The -R[eplace_database] switch WILL overwrite the existing
database, provided you (or your script) are logged in as Sysdba or
Owner. BUT YOU DO NOT WANT TO DO THIS!! The very first thing that
gbak -R does is to delete the existing database. Then, if the
restore fails for any reason, you are left with no database.
Make your batchfile create the database using the temporary new name
(make sure there is not already a file of that name in the directory)
and then have it attempt to log in and run a simple query when the
restore is complete. If that works, then have your script 1) rename
the old database and zip it up and then 2) rename the new database to
the real database name.
./heLen
>I have multiple development databases that are backed-up and restoredIf you use the -C[reate_database] switch you can't restore to a
>every night via scripts. This morning, I find that all of the
>databases were backed up successfully, but none of them restored.
>There were no changes to the scripts. The command in the script looks
>like this:
>
>e:\firebird\bin\gbak.exe -C -user sysdba -password masterkey -p 8192
>-o -v -y f:\ib\company\Logs\RestoreLog.txt
>f:\ib\company\backup\company.fdb.Bak
>f:\ib\company\RestoreTest\company.fdb
>
>The RestoreLog.txt shows this:
>
>gbak: opened file f:\ib\company\backup\company.fdb.Bak
>gbak: transportable backup -- data in XDR format
>gbak: backup file is compressed
>gbak: ERROR: unavailable database
>gbak: ERROR: failed to create database
>f:\ib\company\RestoreTest\company.fdb
>gbak: Exiting before completion due to errors
>
>The database in this case is very small - 28MB. The backup file is
>18.6MB. There is plenty of room on the drive F: (800MB). The folders
>are not read only. There is no file in the RestoreTest folder.
>
>This is a Windows 2000 server running FB1.5 SS.
>
>I am stumped.
database name that already exists in the folder that you are
restoring to. You should use a different file name for the new
database, e.g. company_restored.fdb.
Here it's a case of your being protected by not understanding
that. The -R[eplace_database] switch WILL overwrite the existing
database, provided you (or your script) are logged in as Sysdba or
Owner. BUT YOU DO NOT WANT TO DO THIS!! The very first thing that
gbak -R does is to delete the existing database. Then, if the
restore fails for any reason, you are left with no database.
Make your batchfile create the database using the temporary new name
(make sure there is not already a file of that name in the directory)
and then have it attempt to log in and run a simple query when the
restore is complete. If that works, then have your script 1) rename
the old database and zip it up and then 2) rename the new database to
the real database name.
./heLen