Exforsys.com
 
Home Tutorials SQL Server 2005
 

SQL Server 2005 - Configuring Replication

 

SQL Server 2005 - Configuring Replication

In this tutorial you will learn about SQL Server 2005 - Configuring Replication - New Types of Replication, Peer to Peer Transactional Replication, HTTP Replication, Configuring Replication Configuring Replication Using RMO, Referencing the RMO and SMO libraries and Creating a Subscription Using RMO.

 

Sponsored Links

 

New Types of Replication

New types of replications have been introduced in SQL Server 2005. The first of these is the Heterogeneous Replication which allows the publication of data from heterogeneous subscribers such as Oracle, DB2 using relevant ODBC drive and OLE DB provider. In SQL Server 2005 allows configuration of the snapshot and transaction replication without requiring additional software. The second type is the Snapshot replication from an oracle publisher. This requires the publisher to generate a set of data and the transfer of such data to the subscriber. When oracle is used the SQL Server connects to the Oracle database and retrieves the data without needing a change tracking or insertion of information into the Oracle database. Transactional replication requires that each transaction made to the data at the publisher is tracked, so that it can be replicated to subscribers. While configuring an Oracle publisher from the SQL Server triggers are added to replicate tables created in Oracle for each published table.


Peer to Peer Transactional Replication


The concept of Peer to peer transactional replication is used to increase the server scale out capabilities. All nodes within the system are treated as peers and can be updated simultaneously. Each node has its own Log Reader Agent and Distribution Agent. Therefore, a node can be taken offline for scheduled maintenance without impact on performance and put online again and logs from other nodes can be applied to it.


HTTP Replication


SQL Server 2005 introduces Web synchronization for merge replication and provides the user with the ability to replicate directly over an HTTP or HTTPS connection. This solution will be appreciated by mobile users. The Internet Information Services are used to transfer data between the publisher and the subscriber and subscribers connect to a URL on the web server using authentication parameters configured in the subscription. The messages sent are packaged as XML and encrypted using Secure Socket Layer for security. The IIS communicates in a binary format with the publisher over a TCP/IP network connection. Since HTTP replication is merge replication technology, updates can be made both to rows at both the subscriber and publisher ends. Since the subscriber is mobile, the merge agent runs on the subscriber and configures only pull subscriptions. The synchronization can be configured to run continuously, on schedule or on demand. Subscription is initialized at the subscriber end by a snapshot generated at the publisher and transferred to the subscriber. In Web synchronization the snapshot is delivered as an attachment over HTTP.


Configuring Replication

1. In Object Explorer, expand the Replication folder.
2. Right-click Publications, and then click New Publication.



3. On the New Publication Wizard page, click Next.



4. On the Distributor page, click Next.



5. On the Snapshot Folder page, click Next.



6. On the Publication Database page, click Exforsys, and then click Next.



7. On the Publication Type page, click Transactional publication, and then click Next.



8. On the Articles page, expand Tables, select EmployeeMaster(EmployeeId), and then click Next.



9. On the Article Issues page, click Next.



10. On the Filter Table Rows page, click Next.



11. On the Snapshot Agent page, click Next.
12. On the Agent Security page, click Security Settings



13. In the Process account box, type SQL2005PC\SQLServer. In the Password and Confirm Password boxes, type P@ssw0rd, and then click OK.



14. On the Agent Security page, click Next.
15. On the Wizard Actions page, click Next.



16. On the Complete the Wizard page, enter a Publication name of AWContacts, and then click Finish.



17. When the publication is successfully created, click Close.


Configuring Replication Using RMO

RMO can be used to create managed .NET applications that help in configuring and maintaining replication in SQL Server 2005. RMO is implemented as a class within a .NET assembly called Microsoft.sqlserver.rmo.dll. This assembly contains the Microsoft SqlServer.Replication namespace.


Referencing the RMO and SMO libraries

RMO and SMO libraries can be referenced from the project created in Visual Studio.NET.


1. On the Project menu, click Add Reference.


2. In the Add Reference dialog box, click Microsoft.SqlServer.ConnectionInfo, hold the CTRL key down, and click Microsoft.SqlServer.Replication .NET Programming Interface. Click OK.


Creating a Subscription Using RMO

Replication can be configured using RMO. The typical tasks that will have to be performed are importing the SMO and RMO namespaces, connecting to the subscriber and publisher servers, listing existing subscribers for a publication and creating a new subscription for publication.


In this module we have examined the enhancements made to replication services and the different types of replications that have been introduced in SQL Server 2005. We have also briefly examined how replication can be configured using the options available in the SQL Server 2005 version.



Read Next: SQL Server Integration Services



 

 

Comments


Randall Ulloa said:

  Nice and easy wizard. Do you an example to configure web synchronization for SQL replication?

Regards
August 8, 2006, 3:57 pm

Khushbu Bhalla said:

  Hi i am getting an error while creating the publication , that is after step 17 .. the error code is 21037.. it says invalid working directory..
July 25, 2007, 7:45 am

vaidehi said:

 
Do you hav an example to configure web sychronization for sql merge replication? (in this case the subcriber is not mobile but an desktop having sql compact 3.1)
January 11, 2009, 1:19 pm

0 said:

  How do I enable a read only subscriber? I see that under standard replication this is possible but the Wizard does not enforce at the Subscriber. What I am looking for is a way to stop the users at the Subscription point, from updating the data.
February 12, 2009, 4:32 pm

rhy9200@yahoo.com said:

  I'm using peer-to-peer replication transactional publication to replication/sync data between database in DB1 & DB2. I wanted to do sync of data between these 2 DB. It means that every action (Insert,Update,Delete) on DB1 will then sync into DB2. These also apply vice versa from DB2 to DB1. At the end it's only happen where only sync from DB2 to DB1 but not happen vice versa. Can anyone help me regarding these matter. TQ
March 6, 2009, 4:25 am

Hoa Nguyen said:

  Does anyone know about disadvantage of merge replication in SQL Server 2005
March 12, 2009, 11:03 pm

VijayRod said:

  Disadvantage of merge replication (applies for all SQL versions) -> Merge replication does not maintain transactional consistency. For example if a record is modified and committed on subscriber, it's possible for this record value to be undone due to record change on publisher

Of course merge replication has it's advantages
April 28, 2009, 10:55 am

rem said:

  How about transactional replication? I found out that my synchronization agent is getting slow to execute data synchronization.
May 27, 2009, 10:22 pm

vibaoquoc said:

  Help me every body
Which version of SQL Server 2005 allow replication? I use SQL Server 2005 enterprise edition. But when i install complete, I didn't find "New Publication".
Thank you
May 29, 2009, 11:44 pm

maruthi said:

  how to get replicated data in to new subcriber
June 16, 2009, 12:03 am

zahir said:

  first i want to create Replication of peer to peer computer and after that i want server base Replication.
and i am using Sql Server 2005.

regards
zahir
December 29, 2009, 1:25 am

Sudesh Samapth said:

  Please I need to Create replication for Synchronize over the web, please help me step by step for doing this.
March 1, 2010, 2:18 am

Vasi said:

  Guys,
Remember to configure distribution first before this.
You can use Peer to peer transactional replication also in place of merge replication. Also SQL Server 2008 has good advantages and more handling with Peer to peer replication.
March 16, 2010, 5:28 pm

Post Your Comment:

Members Please Login
Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe    

Sponsored Links

 

 
 

Subscribe via RSS


Get Daily Updates via Subscribe to Exforsys Free Training via email


Get Latest Free Training Updates delivered directly to your Inbox...

Enter your email address:


 

Subscribe to Exforsys Free Training via RSS
 

 
 
Partners -  Privacy and Legal Policy -  Site News -  Contact   Sitemap  

Copyright © 2000 - 2010 exforsys.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape