Clayton’s Database Replication
The scenario: two machines running Sybase ASE 12.5.4. A database that needs to be replicated one-way. Must allow for fast-bcp during the mornings prior to business commencing. Oh, and don’t spend any money.
After poking at ASE Replicator a bit I decided it was (a) too complicated for the job; and more importantly (b) too fragile. It seemed a bit too easy to confuse.
So I’ve written a set of three shell scripts. The first runs after the fast-bcp jobs are done. It disables bulkcopy and truncate-on-checkpoint so the “replication” can even work in the first place. It then takes a full dump of the database and loads it on the secondary machine. Thankfully the database isn’t too big, so the dump/load cycle takes only a few minutes.
Every five minutes during working hours a second script dumps the transaction log and loads it on the second machine. This takes seconds at the moment, though it’ll probably be a bigger job once things go into production. Thus lockfiles.
At the end of the day a third script runs, turning bulkcopy and truncate-on-checkpoint back on, and cleaning up the area on the Filer where these intra-day dumps are going.
It seems to work so far. It’s not very smart, if there’s a problem it’ll send email and bail out, leaving the lockfile in place to impede any further work. But it didn’t take too long to write and it hasn’t involved buying anything, so that much should keep people happy.
Popularity: 29% [?]