Link to home
Start Free TrialLog in
Avatar of Malinthas
Malinthas

asked on

Database Replication Act As Backup?

At work, we're using an Access 2002 database, split into a front & back end.  Occasionally, we'll get a network hiccup, resulting in "disk or network error".  Actually, we get them quite often.  Usually, we just close and restart the database, but occasionally the back end will be corrupted.  We can restore it from the previous night's tape backup, but then we lose the day's work and need to re-enter it all.

We were wondering if we could use database replication as a form of constant, incremental backup.  Could we set up our database back end to replicate, then just copy the replica if the functional back end gets corrupted?  That might result in a much smaller loss of data, right?  Just an idea.
Avatar of naivad
naivad

does repairing the database not work?
ASKER CERTIFIED SOLUTION
Avatar of SidFishes
SidFishes
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Malinthas

ASKER

Not generally.  When we attempt a repair, we get one of two errors; either the database is identified as an unknown format, or it locks us out, saying more than one user is attempting to access the same data at the same time.  At that point, we can't open the file at all, even to attempt another repair.  We also can't get at it to import the data into another database.
one caveat to this is to make SURE you stop the replication "agent" as soon as corruption is noticed...or it will try to replicate the corrupt data...and may hose your replicate as well...
I'm not too worried about replicating the corruption, since Access crashes as soon as the network error occurs.
I developed a solution for this..but it is not so simple.

I have a hidden form that is always open. This form has a timer event on it that is linked to another external database. That databases only purpose is to set a single record in a single table (kickUsers). If I set this value to true, then all of the users get a "5 minutes to close database countdown" if the user is away from the computer, Access will shut itself off.

New people trying to get into the database can't because the first thing the DB looks for is that kickUsers flag isn't set.

I can now modify/compact/repair/backup the database.

I now also have a scheduled task that automates this, captures a list of all the users that are logged into my database when it sets the kickusers flag, compacts and repairs the database, and resets the kickuser flag, then finally notifies all the users that were in the database when it corrupted that it is safe to use the database again.

Unfortunately I moved projects and I don't have access to that code at the moment...I could do it again, but don't have time to do it right this second.
well...you need to run this function from a standalone app...so it won't necessarily crash when your user app does..

also ...for reasons i never investigated...it stops running at midnite...so you need to restart it every morning (or find out what's up with the timer...)

it's not perfect...but it saved my butt more than once.
naivad...i did that as well for a while...and also tried scripting a file copy every 30 minutes but found that for us, replication was the simplest and easiest to deal with...however...we were using replication anyway...the simplest choice is the scripted and chron'd file copy...you don't need to boot users to copy an mdb like you need to with backup...
Your situation does not appear to be a candidate for Database Replication, so I'd avoid it like the plague.

It is intended to accomodate remote users who edit data and synching that data back to a central database, and adds a LOT of overhead to each record, so your application will be slower over time.  

The following MSDN article describes how to 'wash' a database as a preferred method to recover it when repair/compact does not work:  http://support.microsoft.com/default.aspx?scid=kb;en-us;283849

Hope this helps.
-Jim
_________
Jim Horn
Small Business Software Consultant
http://www.jimhorn.biz 

Malinthas - Looks like you've received some solid advice from multiple experts.  Since this question appears to be getting old, please consider awarding points for the effort and closing it.  Thanks in advance.  -Jim