This article is a continuation of the following articles:
I thought to keep the pictorial concept so that anyone can easily set up and map at their end.
Publisher:
The Publisher can be denoted as the origin of the database on which the schema or record amendments take place. Publisher is a point that manages data for replication and sends commands to the distributor for further process, for example, S1.
Subscriber
The Subscribers is the point, where the subscriber database incurs the notification and a copy of the data from the distributor about the changes that happen in the publisher database. The subscriber database generally lives on a different something, for example, S2.
Setting up the Subscriber
Once the publisher (
Snapshot replication (Setting up publisher) in SQL Server) has been set up, it's time to create the subscriber for it.
The following procedure is required to set up the subscriber.
Step 1
Right-click on DBCOmpany_Pub and choose the option “New Subscription” to create a subscription.
Step 2
A Publisher dropdown shows the publisher name that we have created recently in the last activity. Please refer to the image below for reference and click on the Next button.
Step 3
The following window will appear and click on the "Next" button.
Step 4
In this step, we will add new subscribers that will be a different machine or the same machine where we have already set up the Publisher account (for example S2). Kindly refer to the screen captured below for a better understanding. Then click on the Next Button.
Step 5
Please see the image given below and take the necessary action.
Kindly refer to the image below after clicking on the button as advised above in the image. Now choose the necessary actions in a prompted dialog box and press OK.
After fulfilling the window shown above kindly click on the Next button and proceed further.
Step 6
The following window will appear and click on "Next".
Step 7
The following window will appear and click on "Next".
Step 8
Another window will appear and click on "Next".
Step 9
The following window will appear and click on "Finish".
Step 10
A window will appear with some messages for the Successful creation of the Subscription.
Step 11
Expand the publisher and you can see the subscriber as shown in the image below.
Step 12
Expand Replication -> Local Publication the choose publication from there, right-click on the selected publisher and choose Launch Replication Monitor. Kindly refer to the image below:
The Replication monitor describes to you in detail the success or failure of the snapshot replication. You can read all the details from the three options given there.
As soon as we are done with the setup of Subscriber, it's time to watch the replication. As soon as you run the Replication the monitor starts synchronizing the data from the publisher to the subscriber though there may be chances that data is not synchronizing from the publisher to the subscriber, in that case, you just go to view the snapshot agent status to verify its running status as shown in the image below:
The Magic of Data replication is over.
Thanks for reading this. I'll post another part soon.
To learn more about MVC, please go to the following link.
MVC Articles
Enjoy Coding and Reading