Module 2: Creating Efficient Replication Solutions.

Slides:



Advertisements
Similar presentations
Module 5: Routing BizTalk Messages. Overview Lesson 1: Introduction to Message Routing Lesson 2: Configuring Message Routing Lesson 3: Monitoring Orchestrations.
Advertisements

Module 8 Importing and Exporting Data. Module Overview Transferring Data To/From SQL Server Importing & Exporting Table Data Inserting Data in Bulk.
Module 12: Auditing SQL Server Environments
Manipulating Data Schedule: Timing Topic 60 minutes Lecture
Mecanismos de alta disponibilidad con Microsoft SQL Server 2008 Por: ISC Lenin López Fernández de Lara.
SQL Server Replication
Working with SQL Server Database Objects
Moving data using replication Anthony Brown
SQL components In Oracle. SQL in Oracle SQL is made up of 4 components: –DDL Data Definition Language CREATE, ALTER, DROP, TRUNCATE. Creates / Alters.
Adam Thurgar Database Consultant AiT Consultancy Replication with SQL Server ™ – Lessons from the Real World.
Hands-On Microsoft Windows Server 2003 Administration Chapter 6 Managing Printers, Publishing, Auditing, and Desk Resources.
Slide 1 of 9 Presenting 24x7 Scheduler The art of computer automation Press PageDown key or click to advance.
1 Module 2 Installing Windows NT. 2  Overview Preparing for Installation Installing Windows NT Performing a Server-based Installation Troubleshooting.
Module 9: SQL Server 2005 Replication. Overview Overview of Replication Enhancements New Types of Replication Configuring Replication.
Session 7 Creating and Managing Databases. RDBMS and Data Management/ Session 7/2 of 27 Session Objectives Describe the system and user-defined databases.
Overview What is SQL Server? Creating databases Administration Security Backup.
Module 9: Managing Schema Objects. Overview Naming guidelines for identifiers in schema object definitions Storage and structure of schema objects Implementing.
SQL Server Replication By Karthick P.K Technical Lead, Microsoft SQL Server.
IMS 4212: Distributed Databases 1 Dr. Lawrence West, Management Dept., University of Central Florida Distributed Databases Business needs.
Introduction to Databases Chapter 8: Improving Data Access.
Project Implementation for COSC 5050 Distributed Database Applications Lab2.
Distributing Data for Availability and Scalability Don Vilen Program Manager SQL Server Microsoft Corporation.
Module 4: Implementing Transactional Replication.
DAY 15: ACCESS CHAPTER 2 Larry Reaves October 7,
Sofia, Bulgaria | 9-10 October SQL Server 2005 High Availability for developers Vladimir Tchalkov Crossroad Ltd. Vladimir Tchalkov Crossroad Ltd.
DAT201: Introduction To SQL Server ™ Replication Matt Hollingsworth Program Manager Microsoft Corporation.
Module 7: Fundamentals of Administering Windows Server 2008.
DBSQL 14-1 Copyright © Genetic Computer School 2009 Chapter 14 Microsoft SQL Server.
Module 11: Programming Across Multiple Servers. Overview Introducing Distributed Queries Setting Up a Linked Server Environment Working with Linked Servers.
SQL Server Indexes Indexes. Overview Indexes are used to help speed search results in a database. A careful use of indexes can greatly improve search.
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 16: Performing Ongoing Database Maintenance
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.
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 3: Creating Data Types and Tables. Overview Working with Data Types Working with Tables Generating Column Values Generating Scripts.
Chapter 15: Achieving High Availability Through Replication.
DAT 412:Transactional Replication Internals
Indexes / Session 2/ 1 of 36 Session 2 Module 3: Types of Indexes Module 4: Maintaining Indexes.
 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.
Working with SQL Server Database Objects Faculty: Nguyen Ngoc Tu.
Module 5: Implementing Merge Replication. Overview Understanding Merge Replication Architecture Implementing Conflict Resolution Planning and Deploying.
STAGES Language Application Overview. The Language Application is available on a separate URL (typically /stagesLanguage) and tied to only one database.
Module 11: Managing Transactions and Locks
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.
Module 14: Managing Transactions and Locks. Overview Introducing Transactions and Locks Managing Transactions Understanding SQL Server Locking Architecture.
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
Views / Session 3/ 1 of 40 Session 3 Module 5: Implementing Views Module 6: Managing Views.
9 Copyright © 2004, Oracle. All rights reserved. Getting Started with Oracle Migration Workbench.
In this session, you will learn to: Manage databases Manage tables Objectives.
SQL IMPLEMENTATION & ADMINISTRATION Indexing & Views.
SQL Replication for RCSQL Reporting
With Temporal Tables and More
Transactional Replication Deep Dive
Distributed Database Management Systems
Glasgow, SQL Server Meetup
Introduction to transactional replication
Introduction to Replication
Module 5: Implementing Data Integrity by Using Constraints
Overview Implementing Triggers Implementing XML Schemas.
AlwaysOn Availability Groups
Contents Preface I Introduction Lesson Objectives I-2
Presentation transcript:

Module 2: Creating Efficient Replication Solutions

Overview Understanding the SQL Server Platform for Replication Replicating Data and Objects Replicating Data and Executing Objects Designing a Replication Topology Troubleshooting a Replication Implementation

Lesson: Understanding the SQL Server Platform for Replication Understanding Operating System Implications for Replication Understanding SQL Server Installation Implications for Replication

Understanding Operating System Implications for Replication Operating systems that CAN be used for transactional replication Publisher Operating systems that CANNOT be used for transactional replication Publisher Windows NT Windows 95 Windows 2000 Windows 98 Windows XP Windows Me, Windows CE

Understanding SQL Server Installation Implications for Replication Licensing Licensing requirements detailed on Character Sets All servers should use the same character set Collation Use the same collation at Publisher and Subscriber Sort order You may use different sort orders at Publisher and Subscriber

Lesson: Replicating Data and Objects Replicating Table Schema Planning to Publish Table Schema Objects Replicating Filtered Data Replicating Schema Objects – Views, UDFs, and Stored Procedures

Replicating Table Schema Schema changes required by replication Adding tables to track and manage replication Adding columns to identify records You can change the name of the destination table or its columns Changing columns sp_repladdcolumn sp_repldropcolumn On-demand script execution SQL Distributed Management Objects The publication property page Restrictions on dropping columns

Planning to Publish Table Schema Objects Primary key constraints Reference constraints Unique constraints Clustered and nonclustered indexes User triggers Extended properties Collation

Replicating Filtered Data Vertical Filtering ABCDEF ABE Table A Horizontal Filtering ABCDEF ABCDEF Table B Subscriber Publisher

These Objects Rely on These Tables Replicating Schema Objects – Views, UDFs, and Stored Procedures CREATE VIEW vw_EmployeeDept AS... CREATE FUNCTION fn_PayPeriod AS... CREATE VIEW vw_EmployeeDept AS... CREATE FUNCTION fn_PayPeriod AS... CREATE PROCEDURE pr_ValidateVac AS... Replicate View, UDF, Stored Procedures REPLICATED SEPARATELY Replicate View, UDF, Stored Procedures REPLICATED SEPARATELY Replicate Tables

Lesson: Replicating and Executing Objects Reducing Replication Volume with Stored Procedures Replicating Indexed Views as Tables Replicating with On-Demand Script Execution Preventing Data Inconsistencies from the Execution of Stored Procedures

Reducing Replication Volume with Stored Procedures UPDATE 200,000 Rows The execution of stored procedures UPDATE 200,000 Rows Create stored procedure to update affected rows 11 Publish the stored procedure; replication creates copies on each Subscriber 22 Execute the stored procedure on the Publisher 33 EXEC command is replicated 44 Update runs locally on Subscribers

Replicating Indexed Views as Tables Preserve the image of the view data on disk Allow you to replicate view content instead of schema Reduce the amount of data to be replicated

Replicating with On-Demand Script Execution Script execution uses osql.exe Script is replicated 11 Script executes locally Truncate Table Truncate Table Truncate Table Truncate Table Truncate Table Truncate Table Truncate Table Truncate Table

Subscriber Publisher EXEC pr_Update Preventing Data Inconsistencies from the Execution of Stored Procedures UPDATE Table 1 UPDATE Table 2 Table 1 Table 2 EXEC pr_Update UPDATE Table 1 Table 1 UPDATE Table 2 Table 2 Publisher and Subscriber do not match Constraint Violation Table 2 Constraint Violation

Lesson: Designing a Replication Topology Central Publisher and Distributor Republisher for a Slow Link Republisher for Scale Out Central Subscriber with Partitioned Data Bidirectional Partitioned Topology Bidirectional Non-Partitioned Topology

Central Publisher and Distributor Moscow Rome Paris Athens London Berlin headquarters Central Publisher and Distributor Remote Distribution Central Publisher and Distributor

Republisher for a Slow Link Seattle San Francisco Dallas Sydney Hong Kong Beijing Tokyo San Francisco publishes to Seattle, Dallas, and Tokyo Slow link Tokyo republishes to Beijing, Hong Kong, and Sydney

Republisher for Scale Out London Dakar Worldwide Headquarters Rome European Headquarters New York Atlanta North American Headquarters Caracas Madrid

Central Subscriber with Partitioned Data Seattle New York San Francisco Dallas headquarters Mexico City

Bidirectional Partitioned Topology New York The New York Office updates customers in the East Region No conflicts exist The San Francisco Office updates customers in the West Region San Francisco ABCDEF

Bidirectional Non-Partitioned Topology New York Both offices update the same data San Francisco ABCDEF

Lesson: Troubleshooting a Replication Implementation Keep a Performance Baseline Check Replication Alerts Look for Errors by Using Replication Monitor Confirm Mutual Recognition of Servers Validate Data Check Subscription Status Restore the Subscriber to the Current State Removing Replication

Step 1: Keep a Performance Baseline

Step 2: Check Replication Alerts Default Alerts Agent success Agent failure Agent retry Subscriber has passed data validation Subscription cleaned up Subscriber has failed data validation Subscription reinitialized after data validation

Step 3: Look for Errors by Using Replication Monitor

Step 4: Confirm Mutual Recognition of Servers

Step 5: Validate Data Validation Options Compute a fast row count Compute an actual row count Compute a checksum Use stored procedures to validate a subscription sp_article_validation sp_publication_validation sp_table_validation Handling validation failures

Practice: Validate Data Subscribe to a publication Create an invalid row Validate data and receive error message

Step 6: Check Subscription Status sp_helppublication Information about all publications sp_helparticle Information about all articles sp_helpsubscription Information about all subscriptions

Step 7: Restore the Subscriber to the Current StateSynchronizeSynchronize Yes No Yes No Fixed?Fixed? Force replication Fixed? ReinitializeReinitialize CompleteComplete

Removing Replication Removal Sequence Stop the SQL Server Agent Remove replication with wizard Delete the distribution database Delete the Subscriber tables PreparationPreparation Create Scripts Create Scripts

Review Understanding the SQL Server Platform for Replication Replicating Data and Objects Replicating Data and Executing Objects Designing a Replication Topology Troubleshooting a Replication Implementation

Lab 2: Implementing Replication Exercise 1: Determining the Replication Type Exercise 2: Implementing Snapshot Replication Exercise 3: Implementing Transactional Replication Exercise 4: Implementing Merge Replication Exercise 5: Removing Subscriptions and Publications

Lab 2, exercise 1 – Determine the Topology Type Regional Office Mexico City Local Offices Regional Offices Regional Office Boston Regional Office Los Angeles Headquarters St. Louis Regional Office Atlanta Regional Office Chicago

Regional Office Mexico City Local Offices Regional Offices Regional Office Boston Regional Office Los Angeles Headquarters St. Louis Regional Office Atlanta Regional Office Chicago Lab 2, exercise 1 – Determine the Topology Type