Subject | Backup and restore of a database |
---|---|
Author | Anthony Ison |
Post date | 2003-03-18T02:02:16Z |
Hi all,
I'm looking to automatically backup and restore a database after an upgrade.
My first attempt at achieving this has met with almost complete failure.
My approach has been as follows:
1. Backup the database (db1.gdb).
2. Restore to another file (db2.gdb)
3. Copy db1.gdb to db1.gdb.bak
4. Copy db2.gdb to db1.gdb
Unfortunately, this approach has produced a significantly high number of
corrupt databases. I believe it is to do with the fact that I'm copying a
database, that could potentially have a number of connections open while
this is going on.
I want to introduce more tests, etc that will guarantee a non-corrupt
database at the end of the process. This should be the original file if the
backup and resotre was not successful. I would like to be able to do this
on a remote machine except, I don't trust the backups produced (there is no
guarantee they will restore) and I am not really prepared to wait for the
database to restore to a temp location and then restore to the location I
want...
What do others do to regularly maintain their databases? Is a backup and
restore enough? How do you guarantee the system is not in use when you
start a backup and restore? How do you stop someone from using your system
once the backup and restore has been started?
Any help is greatly appreciated!
Thanks
Anthony
PS. A belated thank you to everyone has answered my previous posts. I
don't usually like writing a separate 'Thank you' post... It's too close to
'Me too...' :-)
I'm looking to automatically backup and restore a database after an upgrade.
My first attempt at achieving this has met with almost complete failure.
My approach has been as follows:
1. Backup the database (db1.gdb).
2. Restore to another file (db2.gdb)
3. Copy db1.gdb to db1.gdb.bak
4. Copy db2.gdb to db1.gdb
Unfortunately, this approach has produced a significantly high number of
corrupt databases. I believe it is to do with the fact that I'm copying a
database, that could potentially have a number of connections open while
this is going on.
I want to introduce more tests, etc that will guarantee a non-corrupt
database at the end of the process. This should be the original file if the
backup and resotre was not successful. I would like to be able to do this
on a remote machine except, I don't trust the backups produced (there is no
guarantee they will restore) and I am not really prepared to wait for the
database to restore to a temp location and then restore to the location I
want...
What do others do to regularly maintain their databases? Is a backup and
restore enough? How do you guarantee the system is not in use when you
start a backup and restore? How do you stop someone from using your system
once the backup and restore has been started?
Any help is greatly appreciated!
Thanks
Anthony
PS. A belated thank you to everyone has answered my previous posts. I
don't usually like writing a separate 'Thank you' post... It's too close to
'Me too...' :-)