6 July 2014

Steps to Created Subscriber for Snapshot Replication in sql server

Once you've configured a distributor and created a publication, the last step in configuring SQL Server replication is to create a subscriber who will receive publication updates from the publisher. In this tutorial, we walk through the process of subscribing to a publication, step-by-step. The process may be accomplished either at the publisher or the subscriber


Steps to Create Subscriber 
  • Open SQL Server Management Studio, connect to the publishing server and expand the Replication folder.
  • Expand the Local Publications folder inside of the Replication folder.
  • Right-click on the publication that you wish to create a subscription to and choose New Subscription from the pop-up menu.
  • The New Subscription Wizard will open. Click Next to advance past the initial screens that welcome you to the wizard and confirm the publisher and publication you selected.
  • Select whether you wish to create a push or pull subscription and click Next to continue. In a push subscription, the Distribution Agent will run on the distributor and changes will be sent out to the subscriber as they occur. In a pull subscription, the Distribution Agent will reside on the subscriber and will check in with the publisher periodically to check for available updates.
  • In the next window, select the subscriber server(s) by checking the box to the left of each server you wish to receive the subscription. If the server you wish to use is not listed, click the Add Subscriber button to add it to the list. You should also select the subscription database for each subscriber using the pull-down menu to the right of each selected server. When you are finished, click the Next button to continue.
  • Click the ellipses ("...") button to configure Distribution Agent Security. You will be asked to provide account information that will be used to authenticate the subscription connection. When you are finished, click the Next button to continue.
  • Select a schedule for the Distribution Agent if you wish to vary from the default value of continuous distribution. Click the Next button to continue.
  • Select an initialization time if you wish to vary from the default value of immediately. Click the Next button to continue.
  • Click Next to accept the default value of creating the subscription immediately. Your alternative is to create a script that may be run at a later date.
  • Click the Finish button to create the subscription. SQL Server will provide a status window informing you of its progress creating the new subscription.



Steps to create publication in snapshot replication

you can then use SQL Server Management Studio to create publications that subscribing servers may receive. Each publication contains a collection of database objects that will be replicated to all subscriber servers.

With SSMS open, expand the Replication folder of the publisher and right-click on Local Publications. Then select New Publication from the pop-up menu.

Choose the Publication Database


Choose Publication Type


As shown in the figure above, select the publication type you wish to use:
  • Snapshot publication
  • Transactional publciation
  • Transactional publication with updatable subscriptions
  • Merge publication

Press the Next button to continue.

Choose Article to Publish



Next, you must select the specific articles (objects) within the database that you wish to include in the publication. These are the objects that will be replicated across all subscribers. You may select any tables, user-defined functions or stored procedures. Once you've selected the items you wish to publish, click the Next button to continue

Configuring the Snapshot Agent


You'll want to advance past the Filter Table Rows screen, unless you wish to limit the data included in the publication. On the next screen, you'll have the option to create a snapshot immediately and/or create a schedule for future snapshots using the Snapshot Agent. 

Click on the Security Settings button to provide the account and connection details for the Snapshot Agent, as shown above. Once you've provided the details, click OK to close the Snapshot Agent Security screen and click the Next button to continue.

Finishing Up



Click through to the final screen of the wizard, which allows you to set the publication name. Once you've provided a descriptive name, click the Finish button to create the publication. You'll see the status window shown above while SQL Server creates your new publication.



Steps to create Distubutor for snapshot replication

SQL Server's snapshot replication technology allows you to automatically transfer information between databases to keep them synchronized. In this article, we look at the first step of the snapshot replication process: creating the replication distributor
  • Open SQL Server Management Studio and connect to the database server that you wish to serve as the distributor.
  • Right-click on Replication and choose Configure Distribution from the pop-up menu.
  • Click Next to advance past the welcome screen.
  • Select " will act as its own Distributor; SQL Server will create a distribution database and log", then click the Next button to continue.
  • Click the Next button to accept the default setting that SQL Server Agent should start automatically.
  • Provide a location where SQL Server should store the snapshot replication files by providing either a local folder path or a UNC share name, then click Next to continue.
  • Accept the default name and paths for the distribution database by clicking the Next button.
  • If servers other than the distribution server will publish to this distribution server, provide their information and then click the Next button to continue.
  • Click the Next button to advance to the confirmation screen.
  • Review the choices presented in the Complete the Wizard screen and click Finish to configure your distributor.