DAT320: Merge Replication in SQL Server 2000: Top 10 How To’s Bren Newman Program Manager Microsoft SQL Server Development.

Slides:



Advertisements
Similar presentations
Designing InfoPath Forms: The Dos and Donts Deploying InfoPath Forms: Making the right choice Adding custom business logicin case the built-in stuff isnt.
Advertisements

DEV351 ADO.NET Performance Pablo Castro Program Manager – ADO.NET Team Microsoft Corporation.
SQL Server Replication
Advantage Data Dictionary. agenda Creating and Managing Data Dictionaries –Tables, Indexes, Fields, and Triggers –Defining Referential Integrity –Defining.
Building Enterprise Applications Using Visual Studio ®.NET Enterprise Architect.
Chapter 9 Overview  Reasons to monitor SQL Server  Performance Monitoring and Tuning  Tools for Monitoring SQL Server  Common Monitoring and Tuning.
Managing and Monitoring SQL Server 2005 Shankar Pal Program Manager SQL Server, Redmond.
Passage Three Introduction to Microsoft SQL Server 2000.
OFC324 Microsoft Project Server: Putting Enterprise Project Management (EPM) To Work Sam Brooks
Enterprise Reporting with Reporting Services SQL Server 2005 Donald Farmer Group Program Manager Microsoft Corporation.
DAT304 Leveraging XML and HTTP with Sql Server Irwin Dolobowsky Program Manager Webdata Group.
Richard Smith Senior Consultant – Management, Operations and Deployment Microsoft UK Simple Deployments with Windows AIK and Windows DS.
DBA230 Introducing SQL Server 2000 Reporting Services Jason Carlson Product Unit Manager SQL Server Microsoft Corporation.
IMS 4212: Distributed Databases 1 Dr. Lawrence West, Management Dept., University of Central Florida Distributed Databases Business needs.
DEV334 Creating Application Starting Points & Sharing Best Practices with Enterprise Templates Marc Gusmano Director of Emerging Technologies The Information.
Distributing Data for Availability and Scalability Don Vilen Program Manager SQL Server Microsoft Corporation.
Module 4: Implementing Transactional Replication.
OFC 200 Microsoft Solution Accelerator for Intranets Scott Fynn Microsoft Consulting Services National Practices.
Configuring Identity Manager 2 (formerly DirXML ® ) for JDBC (w/DirXML) Jason Elsberry Software Engineer
DAT201: Introduction To SQL Server ™ Replication Matt Hollingsworth Program Manager Microsoft Corporation.
Developing Reporting Solutions with SQL Server
DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.
Module 2: Creating Efficient Replication Solutions.
DEV325 Deploying Visual Studio.NET Applications Billy Hollis Author / Consultant.
OFC290 Information Rights Management in Microsoft Office 2003 Lauren Antonoff Group Program Manager.
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
Module 6: Implementing SQL Server Replication in an Enterprise Environment.
1 Chapter Overview Introducing Replication Planning for Replication Implementing Replication Monitoring and Administering Replication.
Module 11: Introducing Replication. Overview Introduction to Distributed Data Introduction to SQL Server Replication SQL Server Replication Agents SQL.
Database Design and Management CPTG /23/2015Chapter 12 of 38 Functions of a Database Store data Store data School: student records, class schedules,
Tips and Tricks for Managing and Administering your Enterprise Project Management Server Solution Mike Joe / Karthik Chermakani Software Test Engineer.
Chapter 15: Achieving High Availability Through Replication.
Siebel 8.0 Module 2: Overview of EIM Processing Integrating Siebel Applications.
Chapter 12: Designing a Data- Archiving Solution MCITP Administrator: Microsoft SQL Server 2005 Database Server Infrastructure Design Study Guide (70-443)
DEV333 Instrumenting Applications for Manageability with the Enterprise Instrumentation Framework David Keogh Program Manager Visual Studio Enterprise.
Enabling Enterprise Applications Marcus Perryman Microsoft
DAT 412:Transactional Replication Internals
 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.
06 | Modifying Data in SQL Server Brian Alderman | MCT, CEO / Founder of MicroTechPoint Tobias Ternstrom | Microsoft SQL Server Program Manager.
DAT 332 SQL Server 2000 Data Transformation Services (DTS) Best Practices Euan Garden Product Unit Manager SQL Server Development Microsoft Corporation.
DEV330 Visual Studio.NET IDE Tips and Tricks Billy Hollis Author / consultant.
1 Chapter Overview Defining Operators Creating Jobs Configuring Alerts Creating a Database Maintenance Plan Creating Multiserver Jobs.
Microsoft Management Seminar Series SMS 2003 Change Management.
Enterprise Database Administration & Deployment SIG ▪ 313M ▪ Sept 29, 2005 ▪ 10:15 AM SQL Server 2005 Performance Diagnosis and Tuning using SQL Tools.
MBL490 Deploying Applications to Smartphone and Microsoft® Powered Pocket PC Marcus Perryman Consultant.
EBIZ327 InfoPath and BizTalk Server 2004 Scott Woodgate Jupiter Product Planner.
MSG331 Exchange Server 2000/2003 Software Development Kit Susan Hill Lead Programmer Writer Microsoft Corporation.
Module 5: Implementing Merge Replication. Overview Understanding Merge Replication Architecture Implementing Conflict Resolution Planning and Deploying.
DAT300 SQL Server Notification Services: Application Development Ken Henderson Technical Lead, SQL Server Support Microsoft Corporation
MBL 305 ASP.NET Mobile Controls: Best Practices Gökşin Bakir CSA Yage Ltd. Microsoft Regional Director.
DBA331 Managing a Microsoft SQL Server 2000 Reporting Services Implementation Brian Welcker Group Program Manager SQL Server Microsoft Corporation.
Hosting Websites and Web Applications with Microsoft ® SQL Server ® 2008.
EBIZ302 Jupiter Business Process Automation and Web Services David Fong Program Manager.
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
Developing Custom ASP.NET Providers For Membership And Role Manager Stefan Schackow PRS404 Program Manager – Web Platform and Tools Microsoft Corporation.
DAT 390 Advanced ADO.NET Programming Techniques Jackie Goldstein Renaissance Computer Systems
SQL Database Management
Top 10 Entity Framework Features Every Developer Should Know
Building Enterprise Applications Using Visual Studio®
With Temporal Tables and More
Glasgow, SQL Server Meetup
Power-up NoSQL with Azure Cosmos DB
Microsoft Virtual Academy
Cloud Data Replication with SQL Data Sync
DAT381 Team Development with SQL Server 2005
Introduction to VSTS Database Professional
Presentation transcript:

DAT320: Merge Replication in SQL Server 2000: Top 10 How To’s Bren Newman Program Manager Microsoft SQL Server Development

Merge Replication Primer Replication technology designed for mobile offline/online scenarios Robust conflict detection and handling Allows for advanced data filtering to each subscriber Row or column level change tracking Final state of data is replicated not intermediate states Auto generated triggers track changes

Common deployments Sales force applications Field force automation Server to server with conflicts Pocket PC platform Geographically dispersed data synchronization

Merge Replication in Action demo demo

The Top 10 How To’s

#10 Security in Merge Publication Access List All Merge agents logins in PAL Snapshot Share Writeable to the snapshot agent Needs to be readable by the merge agent account SP3 introduced role based security Users in role are = users in PAL

#9 Implications of Data Convergence Convergence = data consistency Focus on convergence Data could not be uploaded from subscriber Data is removed from subscriber and placed in conflict tables Data could not be downloaded subscriber Data is removed from the publisher and placed in conflict tables Data moves from one user to another Data is removed from one subscription and added to another

# 9 Implications of data convergence Common problems are related to Not for replication (NFR) property not set on constraints (e.g. foreign key relationships) Identity range management not configured on identity columns Use of smallint, int and bigint

#8 What are all the settings on the agent for? Most parameters have very subtle difference Common parameter combinations have been grouped into profiles Server to Server Slow Link Validation Verbose

Selecting a profile demo demo

#7 Change the schema SQL 2000 supports the adding and dropping of columns – via stored procs sp_repladdcolumn sp_repldropcolumn sp_addmergearticle adds incremental article But, requires re-init if publication is filtered sp_addscriptexec executes admin defined script on subscribers

Add/drop columns and sp_addscriptexec demo demo

#6 Replicating over an unreliable network Improve network conditions when possible Increase the value of TcpMaxDataRetransmissions Decrease the number of Src & Dest Threads (reduce parallelism) Put continuous agents in a job loop (i.e. step 3 returns to step 1) More Info available in appendix

#6 Replicating over an unreliable network Improve recoverability by reducing generations per batch Call sp_MSmakegeneration and sp_MSchunkgeneration on large batches of changes

#5 Controlling metadata growth Metadata determines What changes have been made since last synchronization Do two changes conflict? How to resolve conflicts? Metadata is created when User modifies a published table Corresponding rowguid entry MSmerge_contents – inserts & updates MSmerge_tombstone – deletes MSmerge_history – history tracking

Retention period tells replication How long to store metadata Maximum time a subscriber can be active without synchronizing with publisher If exceeded, user needs to re-initialize SQL 2000 >= SP1 Determines whether a cleanup is required and if necessary executes cleanup Subscribers must synchronize within retention period #5 Controlling metadata growth

Why clean up merge metadata Affects merge performance (i.e. synchronization times) and disk space usage Can periodically run DBREINDEX/INDEXDEFRAG on meta-data Example:  100 merge subscribers  10 share same partition  30,000 merges (100 * 300)  3,000,000 data changes (100 * 100 * 300)  16,000 conflicts (0.5%) #5 Controlling metadata growth

#4 Can I sync with a Pocket PC? SQL Server CE uses Merge Replication to synchronize between device and SQL Server Create publication allowing subscription to “Devices running SQL Server CE” Applications written using VS.NET or eMbedded Visual Tools IIS sends changes (file-based) between publisher and subscriber

Daily partitioned merge download Driver allocated assignments Delivers shipments Capture delivery details Delivers shipments Receives change notifications & new instructions Changes merged Merge when cradled #4 Can I sync with a Pocket PC? Customer: Large USA shipping company

#3 How to setup dynamic filtering All SQL Server replication technologies allow for static data filtering Merge allows filtering on a per user or partition basis (called dynamic filtering) Uses built in functions SUSER_SNAME() HOST_NAME()

Ways to optimize dynamic filtering: Avoid complex filter clauses Avoid complex multi-leveled joins Avoid complex UDF’s Ensure filter columns are indexed Validate use = true/false Track duration of sp_MSsetupbelongs and sp_MSmakegeneration #3 How to setup dynamic filtering

Setup a filtered publication & subscription demo demo

#2 I am having an identity crisis

Using identities demo demo

#2 Replicating identities across subscribers What is NFR (Not For Replication)? Bypass for replication agents on constraints Identities need to marked as NFR Risk of running out of range Increase pool size for Publisher and Subscriber Threshold When should replica request a new range Ensure subscriber pool is large enough for autonomy required

#1 Why is my Merge Slow Did you set = True There is no silver bullet for performance and scalability Think “Merge” during db design phase Most common issues are…

#1 Why is my Merge Slow Use the appropriate replication technology Filtering Avoid complex join filter or subset filter statements Index columns involved in filters Set the join unique key property = true when joining between PK-FK Decrease retention period when possible Defragment system table and user table indexes

#1 Why is my Merge Slow Split large batches of changes by calling sp_MSmakegeneration Keep_partition_changes=True Avoids sending deletes to all subscribers on partition changes Apply SP3! Several performance and scalability enhancements!!

Use the Replication Active X control Merge, Snapshot and Distribution agents Any COM evocable development language Commonly Visual Basic and C++/C# etc. Integration with Windows Synchronization Manager Task Bar: Programs -> Accessories -> Synchronize Internet Explorer: Tools -> Synchronize Wildcard: How do I program to the Merge COM object?

Include Reference into development project Microsoft SQL Merge Control 8.0 Set Properties Publisher, Subscriber, Publication, PublisherLogin, QueryTimeout… Execute Methods Initialize, Run, Terminate, AddSubscription, ReinitializeSubscription… ' Set some properties SQLMerge.Publisher = “NEWMAN_SERVER” SQLMerge.Publication = "MERGEDB_PUB" SQLMerge.Subscriber = “SUBSCRIBER_NOTEBOOK” SQLMerge.SubscriberDatabase = “MERGEDB_SUB" ' Run Methods SQLMerge.Initialize SQLMerge.Run SQLMerge.Terminate Eg. Setting Properties & Calling Methods (Visual Basic) Wildcard: How do I program to the Merge COM object?

Additional Information On Diagnosing and Troubleshooting Slow Partitioned Merge Processes on … sql/techinfo/development/2000/slowpartitionedmerge.asp sql/techinfo/development/2000/slowpartitionedmerge.asp Merge Performance and Tuning on …/technet/prodtechnol/sql/maintain/Optimize/mergperf.asp

Appendix… General Network Error: TcpMaxDataRetransmissions Key: Tcpip\Parameters Value Type: REG_DWORD - Number Valid Range: 0 - 0xFFFFFFFF Default: 5 increase to 7 or 8

Ask The Experts Get Your Questions Answered I will be available in the ATE area after this session

Community Resources Most Valuable Professional (MVP) Newsgroups Converse online with Microsoft Newsgroups, including Worldwide User Groups Meet and learn with your peers

evaluations evaluations

© 2003 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.