Module 5: Implementing Merge Replication. Overview Understanding Merge Replication Architecture Implementing Conflict Resolution Planning and Deploying.

Slides:



Advertisements
Similar presentations
Module 13: Performance Tuning. Overview Performance tuning methodologies Instance level Database level Application level Overview of tools and techniques.
Advertisements

Advanced SQL Schema Customization & Reporting Presented By: John Dyke As day to day business needs become more complex so does the need for specifically.
Module 17 Tracing Access to SQL Server 2008 R2. Module Overview Capturing Activity using SQL Server Profiler Improving Performance with the Database Engine.
MCTS Guide to Microsoft Windows Server 2008 Network Infrastructure Configuration Chapter 6 Managing and Administering DNS in Windows Server 2008.
SQL Server Replication
Moving data using replication Anthony Brown
Hands-On Microsoft Windows Server 2003 Networking Chapter 7 Windows Internet Naming Service.
Definition of terms Definition of terms Explain business conditions driving distributed databases Explain business conditions driving distributed databases.
Module 14: Scalability and High Availability. Overview Key high availability features available in Oracle and SQL Server Key scalability features available.
Chapter 9 Overview  Reasons to monitor SQL Server  Performance Monitoring and Tuning  Tools for Monitoring SQL Server  Common Monitoring and Tuning.
Module 8 Implementing Backup and Recovery. Module Overview Planning Backup and Recovery Backing Up Exchange Server 2010 Restoring Exchange Server 2010.
Query Processing in Mobile Databases
Module 9: SQL Server 2005 Replication. Overview Overview of Replication Enhancements New Types of Replication Configuring Replication.
SQL Server Replication
SQL Server Replication By Karthick P.K Technical Lead, Microsoft SQL Server.
Maintaining a Microsoft SQL Server 2008 Database SQLServer-Training.com.
IMS 4212: Distributed Databases 1 Dr. Lawrence West, Management Dept., University of Central Florida Distributed Databases Business needs.
Introduction and simple using of Oracle Logistics Information System Yaxian Yao
9 Chapter Nine Extracting and Transforming Data with SQL Server 2000.
Module 4: Implementing Transactional Replication.
Module 7: Implementing Sites to Manage Active Directory Replication.
DAT201: Introduction To SQL Server ™ Replication Matt Hollingsworth Program Manager Microsoft Corporation.
Module 7: Fundamentals of Administering Windows Server 2008.
Module 10: Monitoring ISA Server Overview Monitoring Overview Configuring Alerts Configuring Session Monitoring Configuring Logging Configuring.
Module 2: Creating Efficient Replication Solutions.
1 Moshe Shadmon ScaleDB Scaling MySQL in the Cloud.
Module 4 Designing Databases for Optimal Performance.
Module 11: Programming Across Multiple Servers. Overview Introducing Distributed Queries Setting Up a Linked Server Environment Working with Linked Servers.
Module 14 Configuring Security for SQL Server Agent.
Module 1: Exploring Replication. Overview Understanding SQL Server Replication Setting Up Replication Understanding Agents in Replication Securing Replication.
Overview – Chapter 11 SQL 710 Overview of Replication
DAT320: Merge Replication in SQL Server 2000: Top 10 How To’s Bren Newman Program Manager Microsoft SQL Server Development.
Module 6: Implementing SQL Server Replication in an Enterprise Environment.
1 Chapter Overview Introducing Replication Planning for Replication Implementing Replication Monitoring and Administering Replication.
Planning Server Deployments Lesson 20. Skills Matrix.
Module 11: Introducing Replication. Overview Introduction to Distributed Data Introduction to SQL Server Replication SQL Server Replication Agents SQL.
Module 5: Upgrading to SQL Server 7.0. Overview Planning an Upgrade Preparing to Upgrade Verifying the Upgrade Setting a Compatibility Level.
Module 7: Resolving NetBIOS Names by Using Windows Internet Name Service (WINS)
Database Design and Management CPTG /23/2015Chapter 12 of 38 Functions of a Database Store data Store data School: student records, class schedules,
1 Chapter Overview Performing Configuration Tasks Setting Up Additional Features Performing Maintenance Tasks.
A Brief Documentation.  Provides basic information about connection, server, and client.
Chapter 15: Achieving High Availability Through Replication.
Module 4 Designing and Implementing Views. Module Overview Introduction to Views Creating and Managing Views Performance Considerations for Views.
Chapter 12: Designing a Data- Archiving Solution MCITP Administrator: Microsoft SQL Server 2005 Database Server Infrastructure Design Study Guide (70-443)
 Replication is the process of copying database information  Replication is used for:  Backing up your database  Migrating to a new server  Mirroring.
SQL Server 2005 Implementation and Maintenance Chapter 12: Achieving High Availability Through Replication.
Module 4: Configuring Active Directory Sites and Replication.
Session 1 Module 1: Introduction to Data Integrity
Learningcomputer.com SQL Server 2008 –Views, Functions and Stored Procedures.
DATABASE REPLICATION DISTRIBUTED DATABASE. O VERVIEW Replication : process of copying and maintaining database object, in multiple database that make.
20 Copyright © 2008, Oracle. All rights reserved. Cache Management.
SCALING AND PERFORMANCE CS 260 Database Systems. Overview  Increasing capacity  Database performance  Database indexes B+ Tree Index Bitmap Index 
Ch 12. Replication. Replication Place copies of data to a different location Use: Reduce locking conflict when multiple sites want to work on same set.
Chapter 1 Database Access from Client Applications.
Module 4: Configuring Active Directory ® Domain Sevices Sites and Replication.
Module 2: Using ADO.NET to Access Data. Overview ADO.NET Architecture Creating an Application That Uses ADO.NET to Access Data Changing Database Records.
1 Information Retrieval and Use De-normalisation and Distributed database systems Geoff Leese September 2008, revised October 2009.
Module 5: Managing Content. Overview Publishing Content Executing Reports Creating Cached Instances Creating Snapshots and Report History Creating Subscriptions.
Log Shipping, Mirroring, Replication and Clustering Which should I use? That depends on a few questions we must ask the user. We will go over these questions.
SQL Server Replication HILARY COTTER SQL SERVER MVP
Data Integrity & Indexes / Session 1/ 1 of 37 Session 1 Module 1: Introduction to Data Integrity Module 2: Introduction to Indexes.
SQL Database Management
SQL Replication for RCSQL 4.5
Transactional Replication Deep Dive
Distributed Database Management Systems
Glasgow, SQL Server Meetup
Introduction to transactional replication
Introduction to Replication
Cloud Data Replication with SQL Data Sync
Overview Multimedia: The Role of WINS in the Network Infrastructure
Presentation transcript:

Module 5: Implementing Merge Replication

Overview Understanding Merge Replication Architecture Implementing Conflict Resolution Planning and Deploying Merge Replication Troubleshooting Merge Replication Tuning Merge Replication

Lesson: Understanding Merge Replication Architecture How the Snapshot Agent Prepares a Publisher How Merge Agent Creates and Synchronizes Subscriptions How Generation Numbers Assist Synchronization The Limited Role of the Distribution Database Location of the Merge Agent

How the Snapshot Agent Prepares a Publisher MSmerge_contents rowguidTableTablerowguidrowguid Triggers Stored Procedures Tablerowguid rowguid UPDATE INSERT rowguid UPDATE DELETE MSmerge_tombstone Saves the row content MSmerge_contents rowguid TableTablerowguidrowguid Triggers Stored Procedures Tablerowguid rowguid UPDATE INSERT rowguid UPDATE DELETE MSmerge_tombstone Saves the row content

How Merge Agent Creates and Synchronizes Subscriptions Reads MSmerge_contents on Subscriber and Publisher Passes Subscriber changes to Publisher Passes Publisher changes to Subscriber If both changed same row identified by rowguid, initiates conflict resolver Merge Agent

How Generation Numbers Assist Synchronization Generation numbers: Help determine what rows need to be updated without reading the entire table. Indicate the last change that has occurred. Are kept independently by Publisher and Subscriber.

The Limited Role of the Distribution Database The distribution database stores: The snapshot location. The identity of the Publisher. The identities of the Subscribers. The time when each Subscriber last synchronized. Locate the distribution database on the Publisher

Location of the Merge Agent Subscriber for pull subscriptions Distributor for push subscriptions

Lesson: Implementing Conflict Resolution Conflict Detection Conflict Resolution

Conflict Detection Change by Manager ALFKI High 3/4/01 Change by Sales ALFKI High 4/7/01 Original RowCustomerCustomer ALFKI PriorityPriorityContactContact Med 3/4/01 Changes are Merged ALFKI High 4/7/01

Conflict Resolution The Publisher has the highest priority so it wins all conflicts that it has with Subscribers. All Subscribers gain the priority of the Publisher with which they synchronize, but only when they synchronize. Whichever Subscriber synchronizes with the Publisher first gains the advantage of the Publisher’s priority first and will win subsequent conflicts with other Subscribers.

Practice: Implementing Conflict Resolution Create table, merge publication, subscription Make changes to table Synchronize the tables and check for conflicts Resolve conflicts

Lesson: Planning and Deploying Merge Replication How to Manage Identity Values Implementing Attachable Subscription Databases Using Dynamic Horizontal Filters Using Dynamic Snapshots Using Join Filters How SQL Server Implements Join Filters

How to Manage Identity Values

Practice: How to Manage Identity Values Create table, merge publication, subscription Add rows Synchronize subscription

Create and configure the publications Create database and pull subscriptions Copy the database and transfer the.msf file Attach the subscription database Start the appropriate Agent Implementing Attachable Subscription Databases

Practice: Implementing Attachable Subscription Databases Create a new database Create a merge publication Configure the publication to allow attachable subscription databases Create a pull subscription Copy the subscription database Copy the.msf file to your partner’s server and attach the database Modify a row Synchronize the subscription database

Using Dynamic Horizontal Filters Benefit of dynamic filters Provide different partitions of data to different Subscribers SUSER_SNAME() Returns the login name for the user’s connection HOST_NAME() Returns the host name for the user’s connection User-defined functions

Using Dynamic Snapshots Create snapshots in advance for later application to disconnected Subscribers Create only the snapshots you need Create snapshots at a convenient time

Practice: Dynamic Filtering with Dynamic Snapshots Create table Add rows Create merge publication Create pull subscription Create dynamic snapshot Create second subscription

Using Join Filters

Views based on views based on views Second View JoinedJoined How SQL Server Implements Join Filters First View JoinedJoined FilteredTableFilteredTable

Practice: Join Filters Create a merge publication with a join filter Create a pull subscription Verify and test the publication and subscription

Lesson: Troubleshooting Merge Replication Troubleshooting by Using the Merge Agent Troubleshooting Slow Merge Performance by Using SQL Profiler Troubleshooting Slow Performance When Using Merge Filters Troubleshooting Subscriptions Using Merge Replication Data Validation

Troubleshooting by Using the Merge Agent Running the Merge Agent Practice "C:\Program Files\Microsoft SQL Server\80\COM\replmerg" -Publisher [VANCOUVER] -PublisherDB [Northwind] -Publication [MergeFilterCustOrdGermany] -Subscriber [DENVER] -SubscriberDB [NorthwindSubscriber] -SubscriptionType 1 -SubscriberSecurityMode 1 -Distributor [VANCOUVER] "C:\Program Files\Microsoft SQL Server\80\COM\replmerg" -Publisher [VANCOUVER] -PublisherDB [Northwind] -Publication [MergeFilterCustOrdGermany] -Subscriber [DENVER] -SubscriberDB [NorthwindSubscriber] -SubscriptionType 1 -SubscriberSecurityMode 1 -Distributor [VANCOUVER] Merge Agent

Select events Select data columns Filter trace information Identify the operations SQL Profiler Troubleshooting Slow Merge Performance by Using SQL Profiler

Practice: Troubleshooting Slow Merge Performance By Using SQL Profiler Create a trace file with SQL Profiler

Troubleshooting Slow Performance When Using Merge Filters sp_MSsetupbelongs Determines which set of rows in each table should be replicated to the Subscriber sp_MSinitdynamicsubscriber Used to query published tables by the merge process

Troubleshooting Subscriptions Using Merge Replication Data Validation Scheduled data validation Select type of validation with - Validate parameter Select how often to validate with - ValidateInterval parameter Special replication validation alert Partial reinitialization Returns the Subscriber to a previous state when data was synchronized

Lesson: Tuning Merge Replication Planning for Efficient Merge Replication Tuning Tuning the Merge Agent’s Performance Tuning Publications Tuning Filters, Indexes, and Filter Queries Tuning the Merge Cleanup Process

Planning for Efficient Merge Replication Tuning Reduce simultaneous merge requests Use faster hardware Optimize replication configuration Stagger the timing of Subscribers’ merge processes Create a hierarchy of Publishers Use Republisher for scale-out

Tuning the Merge Agent’s Performance Select the appropriate Merge Agent profile Default profile High Volume Server-to-Server profile Slow Link Agent profile Force the merge process to upload ExchangeType 3 —upload and download (default) ExchangeType 1 —download only ExchangeType 2 —upload only

Tuning Publications Reconfigure tables that contain text or image columns Use global subscriptions Select the optimize synchronization option

Tuning Filters, Indexes, and Filter Queries Use static filters Partition data into small data sets Use indexes on columns used in filters Rebuild indexes Optimize filtering expressions for indexes Consider denormalization to simplify partitions

Tuning the Merge Cleanup Process Metadata based on retention MSmerge_contents MSmerge_tombstone MSmerge_genhistory Cleanup process Default retention period

Review Understanding Merge Replication Architecture Implementing Conflict Resolution Planning and Deploying Merge Replication Troubleshooting Merge Replication Tuning Merge Replication

Lab 5: Implementing Merge Replication Exercise 0: Lab Setup Exercise 1: Using Dynamic and Join Filters with Merge Replication