Replication is the process of sharing data betweens in different locations. Using replication, we can create copies of the and share the copy with different users so that they can make changes to their local copy of and later synchronize the changes to the source .
Microsoftreplication uses publisher, distributor and subscriber entities.
Publisher is athat makes the data available for subscription to other s. In addition to that, publisher also identifies what data has changed at the subscriber during the synchronizing process. Publisher containspublication(s).
Subscriber is athat receives and maintains the published data. Modifications to the data at subscriber can be propagated back to the publisher.
Distributor is thethat manages the flow of data through the replication system. types of distributors are present, one is remote distributor and the other one local distributor. Remote distributor is separate from publisher and is configured as distributor for replication. Local distributor is a that is configured as publisher and distributor.
Agents are the processes that are responsible for copying and distributing data between publisher and subscriber. There are different types of agents supporting different types of replication.
An article can be anyobject, like Tables (Column filtered or Row filtered), Views, Indexed views, Stored Procedures, and User defined functions.
Publication is a collection of articles.
Subscription is a request for copy of data orobjects to be replicated.
Types of Subscription:
Changes to the subscriptions at the publisher can be replicated to subscribers via PUSH subscription or PULL subscription. With Push subscription, the publisher is responsible for synchronizing all the changes to the subscriber without subscriber asking for those changes. With Pull subscription, the subscriber initiates the replication instead of the publisher.
Microsoft2000 supports the following types of replication:
- Snapshot Replication
- Transactional Replication
- Merge Replication
- Snapshot replication is also known as static replication. Snapshot replication copies and distributes data and objects exactly as they appear at the current moment in time.
- Subscribers are updated with complete modified data and not by individual transactions, and are not continuous in nature.
- This type is mostly used when the amount of data to be replicated is small and data/DB objects are static or does not change frequently.
- Transactional replication is also known as dynamic replication. In transactional replication, modifications to the publication at the publisher are propagated to the subscriber incrementally.
- Publisher and the subscriber are always in synchronization and should always be connected.
- This type is mostly used when subscribers always need the latest data for processing.
It allows making autonomous changes to replicated data on the Publisher and on the Subscriber. With merge replication,captures all incremental data changes in the source and in the target s, and reconciles conflicts according to rules you configure or using a custom resolver you create. Merge replication is best used when you want to support autonomous changes on the replicated data on the Publisher and on the Subscriber.
Replication agents involved in merge replication are snapshot agent and merge agent.
Implement merge replication if, changes are made constantly at the publisher and subscribings, and must be merged in the end.
By default, the publisher wins all conflicts that it has with subscribers because it has the highest priority. Conflict resolver can be customized.
Necessary steps to be taken before doing replication process:
- Before starting the replication process, change the log on account for the MS
- Adequate disk space should be allocated for publisher, distribution and subscriber�s s.
- Use NOT FOR REPLICATION option when defining Identity columns.
Step by Step Procedure for Merge Replication setup
Enterprise Manager and select Tools menu -> Replication -> Configure Publishing, Subscribers, and Distribution�
- Configure the appropriate
- Enable the appropriate
- Enable the appropriate
- Configure the appropriate
- This will open a dialog box for �Create and Manage Publications on respective
- It will ask to choose a Distributor for the selected
- It will ask for the Snapshot folder path. Browse and select the appropriate path for Snapshot folder and then click Next.
Note: Create one folder in the Publisher machine and share the folder, then give full permissions for the user through which you logged in. Make sure that you are able to access this folder from the Subscriber machine also. If you are not able to access, give full permissions to that shared folder for the appropriate user in the Publisher machine. The Snapshot folder should be in the Publisher machine.
- Choose the
- Select the Publication Type as �Merge Publication�.
- Specify the Subscriber Types. Select �
- Select the Object Types (like Tables, Stored Procedures and Views) which you want to publish, and click Next.
- It will show some issues which may require some changes at later stages in order to work as expected. Just click Next.
- Give Publication Name and click Next.
- It will ask to customize the properties of the Publication. Select �Yes, I will define data filters, enable anonymous subscriptions, or customize other properties�. Then click Next.
- Then, it will ask �How do you want to filter this publication?� Don�t select any thing here. Just click Next.
- Then, it will ask �Whether you want to allow anonymous subscription to this publication?�. Select �No, allow only named subscriptions�, and click Next.
- It will show �Set Snapshot Agent Schedule� dialog box. Change the Snapshot Agent Schedule as per your requirement, then select �Create the first snapshot immediately�. And click Next.
- Click Finish to create a Publication.
- Finally, it will show �
- It will show the dialog box �Create and Manage Publications on respective
- Before doing �Push New Subscription�, create new Registration for Subscriber machine in the Publisher machine�s Enterprise manager with Authentication mode. For this, there should be one common login name in both Publisher and Subscriber machines. Set roles for this user as System Administrator, Process Administrator and Bulk Insert Administrators, and give access to the respective for which you want to perform replication.
- Go to �Push New Subscription� wizard. This will open �Push Subscription Wizard�. Just Click Next.
- Choose one or more subscribers from Enabled Subscribers and click Next. (Note: It will show the Subscriber�s
- Choose Subscription (destination)
- �Set Merge Agent Schedule�. Change the Schedule as per your requirement and click Next.
- Specify whether the Subscription(s) needs to be initialized or not. Select �Yes, initialize the schema and data� as well as select �Start the Snapshot Agent to begin the initialization process immediately�, and click Next.
- �Set Subscription Priority� as �Use the Publisher as a proxy for the Subscriber when resolving conflicts�, and click Next.
- It will show the status of the
- Click Finish to complete the Push Subscription.
- Finally, it will show �Subscriptions were created successfully at the following Subscribers:�. Just click Close.
- Now, in the Enterprise Manager, go to the appropriate Group and go to �Replication Monitor -> Publishers -> Respective -> Publication Name�. In the right pane, you will see the snapshot agent. Just right click and select �Start Agent�. Refresh it once. Then right click on the respective publication name and select �Start Synchronizing�. It will merge the necessary data. Refresh it once.
2000 replication will not support full-text indexing. But, enable full-text indexing at the subscriber machine manually. This can be done by Full-text indexing wizard. Select the appropriate table and enable the required fields in that table as full-text indexed. Then, create a new catalog or else use the existing catalog and schedule it, if needed. Once this is done, go to that particular catalog and right click and select �Start full population�. The status will be displayed as �population in progress�.
Advantages in Replication:
Users can avail the following advantages by using replication process:
- Users working in different geographic locations can work with their local copy of data thus allowing greater autonomy.
- replication can also supplement your disaster-recovery plans by duplicating the data from a local to a remote . If the primary fails, your applications can switch to the replicated copy of the data and continue operations.
- You can automatically back up a by keeping a replica on a different computer. Unlike traditional backup methods that prevent users from getting access to a during backup, replication allows you to continue making changes online.
- You can replicate a on additional ne rk s and reassign users to balance the loads across those s. You can also give users who need constant access to a their own replica, thereby reducing the total ne rk traffic.
- -replication logs the selected transactions to a set of internal replication-management tables, which can then be synchronized to the source . replication is different from file replication, which essentially copies files.
Replication Performance Tuning Tips:
- By distributing partitions of data to different Subscribers.
- When running replication on a dedicated , consider setting the minimum memory amount for to use from the default value of 0 to a value closer to what normally uses.
- Don�t publish more data than you need. Try to use Row filter and Column filter options wherever possible as explained above.
- Avoid creating triggers on tables that contain subscribed data.
- Applications that are updated frequently are not good candidates for replication.
- For best performance, avoid replicating columns in your publications that include
In a nutshell, replication is the capability to reliably duplicate data from a sourceto one or more destination s. 2000 gives you the power for replication design, implementation, monitoring, and administration. This gives you the functionality and flexibility needed for distributing copy of data and maintaining data consistency among the distributed. You can automatically distribute data from one to many different s through ODBC (Open Connectivity) or OLE DB. replication provides update replication capabilities such as Immediate Updating Subscribers and merges replication. With all the new enhancements to replication, the number of possible applications and business scenarios is mind-boggling.