Using Replication Manager
|Archived content. No warranty is made as to technical accuracy. Content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.|
This installment of the Jet replication series focuses on Replication Manager 4.0, a tool that can simplify the management of distributed Jet replica sets in many ways. For example, Replication Manager facilitates the administration of replica sets over LANs, WANs, and the Internet. The Synchronization Schedule feature enables synchronizations without manual intervention. IT pros can readily manage distributed replicas on laptops through Replication Manager's indirect synchronization capabilities. The graphical user interface in Replication Manager can eliminate the need to program custom solutions in certain situations (and vastly reduce the need for programming in other cases), but using Replication Manager to craft solutions requires a license for the Microsoft® Office 2000 Developer edition (MOD).
In this article, I'll discuss the core functionality offered by Replication Manager. You'll learn how to install, configure, and start using it. I'll also give you a URL for obtaining more information about Internet replication. The examples in this article demonstrate must-know capabilities. Understanding these capabilities will prepare you sufficiently for designing and implementing advanced Jet replication solutions.
Replication Manager Maps and Synchronizers
The most distinguishing feature of Replication Manager is its map for managing replica sets. Synchronizers play a major role in the appearance of replica set members on the map.
When you're using Replication Manager, all data exchanges between replicas occur through synchronizers. Although they manage replicas, synchronizers belong to those machines (workstation or server) to which the Replication Manager has been installed. After installing Replication Manager, you must configure it, which enables you to make a number of settings that affect the synchronizers, such as their names and their ability to enable indirect synchronization.
With Microsoft® Windows NT®, synchronizers run as a Windows NT service. On Microsoft Windows® 9x computers, the synchronizer starts with the launch of Replication Manager. To take automatic advantage of indirect synchronization, install Replication Manager in the Startup folder on Windows 9x machines. While all the replicas in a set can belong to a single synchronizer, you will often design your applications with multiple synchronizers—one per replica or group of replicas. Any replica on a laptop computer must have a synchronizer to participate in indirect synchronization. Replica set members not assigned to a synchronizer cannot synchronize with other members through Replication Manager.
Figure A shows a replica set with three synchronizers. In this configuration, the CAB2200 synchronizer manages the Design Master. The map displays links for this synchronizer to two others. The CABXLI and CAB1700 synchronizers contain global replicas, so they can synchronize with one another and the Design Master. Therefore, the CABXLI and CAB1700 synchronizers have lines connecting to each other. Each synchronizer icon has a context-sensitive menu, which varies depending on the map and the synchronizer. The commands for the CAB2200 synchronizer on the CAB2200 map are different from those for the CAB2200 synchronizer on the CABXLI map. There are also context-sensitive menus for the lines connecting synchronizers, and they vary according to the synchronizers they connect and the map to which they belong.
Installing Replication Manager and Populating its Map
Before creating replicas and populating a Replication Manager map, you must install the product from the MOD CD. Choose Office 2000 Developer Tools from the Installation Wizard. If you've previously installed any other MOD tools, you can immediately select the check box for Microsoft Replication Manager and any of the other three tools you want installed. If this is the first installation of MOD tools, you will pass through some other screens first. The wizard will complete the installation, but it will not configure Replication Manager.
You can launch Replication Manager initially from the MOD menu of the Windows Start button. With a fresh installation, the application prompts you automatically to configure it. Usually, you will want to specify indirect synchronization (see Figure B). Recall that this option permits you to create synchronization files for a replica that is not currently connected to a network. When the replica on the disconnected computer reconnects to the network, it reads the files automatically to update its copy of the database.
The strategy for mapping replicas into a synchronizer can start with an unconverted Jet database or a previously converted database. If you start with an unconverted database, use the Convert Database To Design Master Wizard. You can invoke this wizard from the Tools menu or by pressing the appropriate button on the toolbar. The wizard offers screens that simplify these tasks:
Making a backup
Naming the replica set that you spawn from it
Selecting all or some database objects as replicable
Making the replica read/write or read-only by users
Assigning the replica to the current synchronizer or leaving it unmanaged
If the first replica in a synchronizer comes from an existing replica set, you can open a replica set member by issuing the Open Replica Set command from the File menu. If the replica was previously unmanaged, right-click the icon for the replica and choose Start Managing. This action converts the icon from a collection of datasheets to a computer within a red square. If the first replica member in the synchronizer is a Design Master, the icon includes a computer and design triangle inside the square.
After adding the first replica to a synchronizer, you can attach more replicas for that synchronizer to manage. When assigning previously existing replicas, use the File menu's Open Replica Set command. This command opens a dialog box that asks if you want to manage the replica with the current synchronizer. Choose Yes to have the synchronizer add this replica to those it is already managing. Choose No if you want to use its context-sensitive menu to examine the properties or synchronization history of the replica from any previous participation in replica sets managed by the synchronizer.
You can also create new replicas for management by the current synchronizer or by another synchronizer participating in the management of replica set members. Invoke the Create New Replica Wizard by pressing the New Replica button on the Replication Manager toolbar. In Figure C, the tool for opening the wizard is highlighted and the wizard's initial dialog box is displayed. Invoke this wizard to:
Specify a destination for the new replica
Designate the replica as read/write or read-only
Specify that the current synchronizer will manage the replica, that another synchronizer will manage it, or that it will remain unmanaged
As you add new synchronizers for the management of a replica set, you will need to inform the previously existing synchronizers of their availability. You do this by adding the replica that is managed by a new synchronizer to the map for the previously existing synchronizer. Follow these steps:
Use the File menu's Managed Replicas command in the old synchronizer to add the replica from the new synchronizer as a managed replica.
Stop managing it.
After releasing the replica, synchronize the replica with itself in the new synchronizer. This action makes both synchronizers available on the map for the new synchronizer.
If the new synchronizer does not appear automatically on the map of the old synchronizer, choose Refresh Synchronization from the Tools menu in the old synchronizer to update its map with the name of the new synchronizer.
From the File menu, select the original replica from the old synchronizer to make it open.
Selected Tools and Commands
After you construct maps for two or more synchronizers, you can start managing your replica set with the synchronizers. There are four entry points for managing a replica set with Replication Manager: the menu bar, the toolbar, the context-sensitive menus for synchronizer icons, and the context-sensitive menus for lines connecting synchronizer icons.
The preceding examples already demonstrated a couple of uses for the File menu. The options on the File menu enable you to open and close replicas and to determine which replicas a synchronizer manages. Another important function of this menu is to enable the moving of the Design Master and other replicas. To invoke the Move Replica command, you must have exclusive use of the replica so that it cannot be opened in Microsoft® Access or synchronized with another replica. Although it's possible to move replicas with Windows and MS-DOS® commands, it can result in the loss of conflict information, and it can demote a Design Master to a standard global replica.
In addition to managing the look of a map, the View menu offers useful management capabilities. You gain access to these capabilities through the three-tabbed dialog box that opens when you select the Properties command from the View menu. The Replica Set tab enables you to change the retention period for structural changes to a Design Master. Jet replication stores information about deleted records in a system table (MSysTombstone), and the retention period affects the duration of time over which a replica retains information about the deletions. Both design changes and deleted records can bloat the size of members in a replica set. Reducing the retention period can minimize the bloating. Be sure to synchronize replica set members before reducing the retention period, or you may lose updates. You can modify the retention period exclusively from the Design Master, but you can view the setting from any replica.
When working with a Design Master, you can also use the Properties dialog box to view and update the replicability status of database objects, such as tables and queries. With other replicas, the Properties dialog box enables you to view only the replicability status of objects. Click the Modify Object Status button on the Open Database tab of the Properties dialog box to view and update the replicability status of database objects.
The View menu's Synchronization History command lets you review the outcome of synchronization attempts between a map's open synchronizer and any other synchronizer on the map. You can filter the information about prior synchronizations by the number of attempts (25 or 50), the date of synchronization (the last two days or last week), types of changes (data and design, data only, or design only), and more. The Synchronization History dialog box is especially helpful for tracking automatically scheduled synchronizations and synchronizations that failed.
The Tools menu contains several commands that fundamentally empower Jet replication. Earlier I mentioned the Configure Microsoft Replication Manager, Convert Database To Design Master, and Refresh Synchronization Window commands—these are all available from the Tools menu. The Synchronize Now command enables the synchronization of all replicas in a set, just those at the local synchronizer, or those between the local synchronizer and any other individual synchronizer (see Figure D). You can also use the Synchronize Now dialog box to control the flow of exchanges between the replicas managed by synchronizers. Another particularly useful command is the Edit Database In Microsoft Access. You can use this option to launch Microsoft Access for a synchronizer's open replica. Some other items rounding out the capabilities of the Tools menu are Resolve Conflicts, Edit Synchronization Schedule, and Synchronize Now Across The Internet.
Right-clicking a synchronizer's icon in the Replication Manager map opens a range of options specific to that synchronizer. These two menu item collections overlap partially. The local synchronizer has the most comprehensive set. For example, the command for stopping the management of a replica is available on the local synchronizer's menu. It also enables you to open the Properties dialog box for a synchronizer and to open another dialog box that summarizes the meaning of the seven different kinds of synchronizer icons. Another command opens the Synchronization History dialog box, which is available from the View menu, too. The View Synchronizer Log File command is not available from any other menu. This command opens a text log file that chronicles all synchronizer activity, and it reports outcomes with more detail than the Synchronizer History dialog box. Two other commands help to specify automatically scheduled synchronizations.
The context-sensitive menu for non-local synchronizers includes two new items, as well as three commands from the local synchronizer menu. The Synchronize Now command opens a Replication Manager dialog box that can launch a direct synchronization between the local synchronizer and the remote synchronizer (which is represented by the icon). The Remove Defunct Synchronizer command removes the icon for a synchronizer from a map, but the synchronizer still remains on the maps for other synchronizers (unless you remove it from those as well).
Direct Synchronizations and Automatic Schedules
Direct synchronizations require that all participating replicas reside on computers with an active connection to the network. This connection can be through either a LAN or a WAN.
Replication Manager, through its synchronizers, embellishes direct synchronization in three ways. First, it enables synchronization across the replicas managed by a local synchronizer. Database administrators are relieved of designating separately all appropriate pair-wise replica combinations in a replica set at a synchronizer. Second, it facilitates the transmission of data and design changes between two synchronizers (and, consequently, their managed replicas). Third, it enables you to schedule direct synchronizations to occur automatically at designated intervals.
You can launch on-demand direct synchronizations with the Synchronize Now command on the Tools menu or the Synchronize Now command for remote synchronizers on a map. Both approaches open the same dialog box shown in Figure D. This dialog box makes it clear why all replicas need a synchronizer: Replication Manager has no means of arranging for synchronization between replicas not managed by a synchronizer. Of course, you can still use Access' Synchronize Now command or launch synchronization between replicas programmatically.
With Replication Manager, database administrators can schedule synchronizations automatically. The synchronization schedules have three settings:
All replicas managed by the local synchronizer
Any new replica managed by the local synchronizer
Any pair of synchronizers on a map, including the local synchronizer and another remote synchronizer
Figure E shows the Edit Schedule dialog box for automatic synchronizations between the CABXLI and CAB2200 synchronizers. You can open this dialog box from either synchronizer by right-clicking the line between the synchronizers and choosing Edit Synchronization Schedule. Any other synchronizer can open the dialog box, too—but not for editing. An aqua bar denotes synchronizations initiated by the CABXLI synchronizer at 3:15 AM, and a red bar denotes another round of synchronization initiated by the CAB2200 synchronizer at 5:00 AM. If the computer running a synchronizer is not on the network, a synchronizer can, optionally, save the changes to a drop-box folder for retrieval when the computer reconnects to the network. This action depends on the configuration of synchronizers and the location of the drop-box folder.
Indirect Synchronization and Internet Synchronization
On-demand and scheduled synchronizations are great—so long as the other synchronizer runs on a computer with an open connection to the network. However, this is not true all the time for many laptop computers and computers at branch offices with a Web connection to the company's intranet server. In these situations, the ability for Jet replication to serve occasionally connected computers is vital. Replication Manager accommodates these two scenarios with indirect synchronization and Internet synchronization.
Indirect synchronization is the more straightforward of the two. This type of synchronization requires two configuration settings. First, you must configure the synchronizers for the computers so that they support indirect synchronization (see Figure B). However, this is not enough. You must also designate a drop-box folder for the laptop on the database server or another computer that always has a connection to the database server's LAN. Designate the drop-box folder on the fourth screen of the Configure Replication Manager Wizard, as shown in Figure F.
The drop-box folder acts as a temporary receptacle for the data update files between the server and the disconnected computer. When the laptop computer reconnects to the network, it retrieves its update files automatically from its drop-box on the database server. Indirect synchronization requires synchronizers on the laptop and database server computers. The synchronizers actually manage the flow of information between the drop-box and the replica on the laptop.
The Office 2000 release of Access and Replication Manager introduced features in four areas to enhance Internet synchronization. First, this style of synchronization permits the transfer of updates by HTTP 1.1 protocol and FTP protocol, which enables updates to pass from behind a proxy server to clients on the other side. Second, performance enhancements relating to encryption can reduce transfer times over a Web. Third, replicas can assume an anonymous visibility. They do not appear on a synchronizer's map, which reduces the map clutter when there are many remote clients that link occasionally to a Web server running Replication Manager. Fourth, several new registry keys enable the fine-tuning of clients for busy Web servers with heavy synchronization loads and unusually long response times. (You can lengthen selected timeouts for Internet synchronization.)
Internet synchronization does not require a synchronizer on the browser. Jet and Windows DLLs on the client and server handle the transfer of data and design changes to and from the client. All anonymous client replicas use a common drop-box on the server.
While the operation of Internet synchronization can be straightforward, its configuration is not because you must set up a Web server and a Replication Manager to accommodate the task. A white paper by Michael Wachal describes how to configure the Web server and Replication Manager. After configuration is complete, you must make a master copy and distribute the copy to clients. All clients can work with a copy of a single replica that is "stamped" with the correct information.
In this article, I introduced the basics of using Replication Manager 4.0, which ships with MOD. I explained how to configure Replication Manager and control the content on its synchronizer map, and I illustrated techniques for automating synchronizations within a replica set. Finally, I presented a variety of techniques for handling occasionally disconnected computers, such as using laptops and connecting computers to a Web server via a browser.
Rick Dobson, Ph.D., and his wife operate a consulting office for development and training. Rick is the author of Programming Microsoft Access 2000 for Microsoft Press. He has presented training sessions and seminars on Access and Web development topics in Australia, Canada, the United Kingdom, and throughout the United States. Rick is a Microsoft Certified Professional and a Microsoft Certified Trainer. His consulting firm markets a collection of Access 2000 training kits. You can reach Rick at either of the two Web sites that his practice maintains ( http://www.programmingmsaccess.com and http://www.cabinc.net ).
The above article is courtesy of TechRepublic http://www.techrepublic.com .
We at Microsoft Corporation hope that the information in this work is valuable to you. Your use of the information contained in this work, however, is at your sole risk. All information in this work is provided "as -is", without any warranty, whether express or implied, of its accuracy, completeness, fitness for a particular purpose, title or non-infringement, and none of the third-party products or information mentioned in the work are authored, recommended, supported or guaranteed by Microsoft Corporation. Microsoft Corporation shall not be liable for any damages you may sustain by using this information, whether direct, indirect, special, incidental or consequential, even if it has been advised of the possibility of such damages. All prices for products mentioned in this document are subject to change without notice.