Subject | Re: GBAK error on the running database |
---|---|
Author | Dipesh |
Post date | 2006-11-15T18:58Z |
Hi,
Thank you Adam and Nigel for replying and commenting on this thread.
Adam:
=====
I have introduced step 1 and 2 as I thought there might be something
which has to do with service already started. Initially i had only
step 3, I will revert to it again.
So do yo mean I shall copy the database after killing the service? So
my steps would be
kill the service
copy the database
start the service
then shutting it forcefully and then rest of the steps.
I will try again with -g option and see how does it perform.
Thanks for your input.
Nigel:
=====
Thanks for providing your shell script. I have written something like
this in php as I am working on windows and using php as my server side
scripting language.
Actually I am using this script in archiving(date wise archiving) the
current database which forks two database, archived one and the one
left after archiving. In case if my current database in corrupted
state or highly inflated with all the extra space in it, i thought it
is better to get rid of those and then archive it and again run this
script on each of these database and make it usable and in good condition.
Further, I am thinking to schedule this script to run weekly so that
the database is always in good state. This is because I have seen
sometime when database becomes big (> 1 GB) and some actions which I
am not sure about corrupts our database.
Thank you for you input.
I will update here after trying out options quoted by Nigel.
Regards,
Dipesh
Thank you Adam and Nigel for replying and commenting on this thread.
Adam:
=====
I have introduced step 1 and 2 as I thought there might be something
which has to do with service already started. Initially i had only
step 3, I will revert to it again.
So do yo mean I shall copy the database after killing the service? So
my steps would be
kill the service
copy the database
start the service
then shutting it forcefully and then rest of the steps.
I will try again with -g option and see how does it perform.
Thanks for your input.
Nigel:
=====
Thanks for providing your shell script. I have written something like
this in php as I am working on windows and using php as my server side
scripting language.
Actually I am using this script in archiving(date wise archiving) the
current database which forks two database, archived one and the one
left after archiving. In case if my current database in corrupted
state or highly inflated with all the extra space in it, i thought it
is better to get rid of those and then archive it and again run this
script on each of these database and make it usable and in good condition.
Further, I am thinking to schedule this script to run weekly so that
the database is always in good state. This is because I have seen
sometime when database becomes big (> 1 GB) and some actions which I
am not sure about corrupts our database.
Thank you for you input.
I will update here after trying out options quoted by Nigel.
Regards,
Dipesh
--- In firebird-support@yahoogroups.com, "Nigel Weeks" <nweeks@...> wrote:
>
> Why don't you just gbak a running database, restore it to a temporary
> database location, and be done with it.
>
> That'll save all this dangerous killing of processes, and copying of
> database files, etc.
>
> N.
>
> -----Original Message-----
> From: firebird-support@yahoogroups.com
> [mailto:firebird-support@yahoogroups.com]On Behalf Of Dipesh
> Sent: Wednesday, 15 November 2006 1:26 PM
> To: firebird-support@yahoogroups.com
> Subject: [firebird-support] GBAK error on the running database
>
>
> Hi,
>
> I am trying to run gbak and restore on the database which is running
> by following the steps mentioned below. (This is in my script)
>
> 1) Stop the database. (killing firebird server)
> 2) Start the database.
> 3) gfix shut (forcefully shutting the database)
> 4) Copying the database as repair_myDB.fdb
> 5) gfix validate (Validate the copied database)
> 6) gfix mend (Mend the validated database i step5)
> 7) gfix validate (Validate the mended database again)
> 8) gbak validated database from step 7 into my backup location.
> This step creates a backup file but the process gbak in windows is
> running forever and not returning. When i manually run the same
> command i.e. gbak it works perfectly fine and creates a file which is
> larger than the file created by the hanging process.
> 9) gbak restore from the backup file created in step 8
> 10) gfix validate (validate the restored database file)
> 11) stop the database server.
>
> 12) Rename the main database file i..e myDB.fdb to myDB_timestamp.fdb
> 13) Rename my restored file to the same file as it was in step1 i.e.
> myDB.fdb
>
> 13) Restart the database.
>
> If I manually do steps 8 and 9 it works fine but when I am running
> this script programatically it is halting somewhere. When I killed the
> process and tried to restore the database from the backup file
> generated from this halted process it gave me following error.
>
> Done with volume #1,
> "Path_to_backup_file\Backup_20061114_161716_myDB.fdb.fbk"
> Press return to reopen that file, or type a new
> name followed by return to open a different file.
> Name:
> => I have pressed enter above.
> Expected volume number 2, found volume 1
> gbak:
>
> Could not read from file
> "Path_to_backup_file\Backup_20061114_161716_myDB.fdb.fbk"
>
> Done with volume #1,
> "Path_to_backup_file\Backup_20061114_161716_myDB.fdb.fbk"
> Press return to reopen that file, or type a new
> name followed by return to open a different file.
> Name:
> => I have pressed enter above.
> Expected volume number 2, found volume 1
> gbak:
>
> Could not read from file
> "Path_to_backup_file\Backup_20061114_161716_myDB.fdb.fbk"
>
> Done with volume #1,
> "Path_to_backup_file\Backup_20061114_161716_myDB.fdb.fbk"
> Press return to reopen that file, or type a new
> name followed by return to open a different file.
> Name: 1
> => I have pressed 1 above.
> gbak: ERROR: expected backup description record
> gbak: Exiting before completion due to errors
>
> I have run my above script programatically on the database which were
> not running. I am doing something wrong above.
>
> Any input to figure out this problem will be highly appreciated.
>
> Thank you.
> Regards,
>
> Dipesh
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>