|   | Foxhound is the better* Database Monitor for SQL Anywhere. *better: More thorough, more relevant, more effective. ...more Alerts, more All Clears, more details, more control in your hands. | 
| [Home] | [Table of Contents] | [Previous Section] | [Next Section] | 
Breck Carter
Last modified: February 23, 1998
mail to: bcarter@bcarter.com
Some people have no trouble understanding replication. That's because they're very smart. They don't have any difficulty dealing with sophisticated arrangements of multiple databases on multiple computers all exchanging data with each other. Those, of course, are the people who should be in charge of replication.
Then there's the rest of us. Folks like me who do find it hard to keep track of complex environments that keep changing all the time. And that can spell trouble when we're the ones put in charge.
SQL Anywhere replication looks straightforward on paper. The product is well designed and implemented, each step is simple, and each command and program is easy to understand. It's just that there are so many steps and so many commands and programs to run that real life gets very complicated very fast.
And error prone too. Each step offers an opportunity for something to go wrong, a chance for you to make a mistake. Replication errors can have profound implications, even something as simple as "Oops, I forgot to do that" or running commands in the wrong order. Mistakes can cascade and cause other symptoms, eventually destabilizing the replication network and causing lost or inconsistent data. You can tell this has happened when you hear yourself groan, "Oh, no, I gotta run DBXTRACT again!"
This document is an attempt to fill the gap between understanding the basics of SQL Anywhere replication and dealing with a production system. It is a detailed examination of the steps required to run a simple replication setup. Unlike some tutorials, this demonstration actually uses more than one computer.
The purpose is three-fold:
The important word above is "detailed". You can follow along and run the commands or just read the step-by-step instructions, either way you won't be missing much. If you think it's too detailed, well, you're probably one of those bright folks who don't need to read it anyway.
Here's a list of what this document is not:
This is the kind of article that once you put it down, you can't pick it up again.
Well, maybe it's not that bad. But it did cause one early reviewer to coin the phrase "publish subscribe repitation".
Figure i1 lists the basic characteristics of publish subscribe replication with SQL Anywhere.
Figure i1 - A Replication Refresher
| 
 
          CREATE PUBLICATION publication-name
             ( TABLE table-name SUBSCRIBE BY column-name )
 
          CREATE SUBSCRIPTION TO publication-name
             ( 'column-value' ) FOR target-database-user-id
 | 
Figure i2 presents some basic assumptions and options in effect for this demonstration.
Figure i2 - Let's Make Some Assumptions
| 
 | 
This document is divided into five sections:
Figure i3 shows the Sections and Steps "at a glance": what programs are run, when they're run and in what order, and what files are passed back and forth. This list may make more sense after you've had a chance to read some of the document... come back here when you need a road map.
Figure i3 - Steps And Sections At A Glance
| 
            Central           File           Remote             See
Section      Server         Transfer        Computer           Step
-------  --------------   -------------    --------------      ----
  One    DBINIT, DBSRV50                                          2
         ISQL CREATE                                              2
  Two    DBXTRACT Reload                                          5
                             Reload -->                           8
                                           DBINITW                9
                                           ISQLW Reload           9
 Three   ISQL Update A                                           14
         DBREMOTE A                                              17
                                           ISQLW Update B        19
                             A -->                               22
                                           DBREMOTW A, B         23
         ISQL Update C                                           26
                               <-- B                             29
         DBREMOTE B, C                                           31
                                           ISQLW Update D        34
                             C -->                               37
                                           DBREMOTW C, D         40
 Four    ISQL Update E                                           43
                                           ISQLW Update F        46
         ISQL Synchronize                                        49
         DBREMOTE Synch                                          52
                             Synch -->                           54
                                           DBREMOTW Synch        56
 Five    ISQL Change DDL                                         59
         ISQL Passthrough                                        61
         DBREMOTE Passthrough                                    64
         ISQL Start Replication                                  66
         DBREMOTE Start Rep                                      69
                           Pass, Start -->                       71
                                           DBREMOTW Pass, Start  73
 | 
In the body of this document some of the steps are marked "required". That means these steps are necessary if this demonstration is going to make any sense at all. They may or may not be needed for real-world replication setups, and even if they are they may look different.
Other steps are marked "suggested" and "optional" which means they aren't absolutely necessary even for this demonstration.
Figure i4 is an alphabetic list of the various batch, SQL and other files provided with this demonstration. It also shows where each file is used: on the central server, remote computer, or both.
Figure i4 - Files Provided With This Demonstration
| 
 | 
These files are all placed in the C:\TEST directory on the central server and remote computers. Complete listings appear elsewhere in this document, and the files are also available in machine readable form.
Batch files and command lines are used in this document instead of Sybase Central for the following reasons:
Figure i5 lists some of the other documents and resources that contain information about replication with SQL Anywhere.
| 
 | 
| [Home] | [Table of Contents] | [Previous Section] | [Next Section] |