Glasgow, SQL Server Meetup

Slides:



Advertisements
Similar presentations
Mecanismos de alta disponibilidad con Microsoft SQL Server 2008 Por: ISC Lenin López Fernández de Lara.
Advertisements

SQL Server Replication
FlareCo Ltd ALTER DATABASE AdventureWorks SET PARTNER FORCE_SERVICE_ALLOW_DATA_LOSS Slide 1.
Moving data using replication Anthony Brown
Adam Thurgar Database Consultant AiT Consultancy Replication with SQL Server ™ – Lessons from the Real World.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 12: Managing and Implementing Backups and Disaster Recovery.
Module 14: Scalability and High Availability. Overview Key high availability features available in Oracle and SQL Server Key scalability features available.
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.
High-Availability Methods Lesson 25. Skills Matrix.
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.
Distributing Data for Availability and Scalability Don Vilen Program Manager SQL Server Microsoft Corporation.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 12: Managing and Implementing Backups and Disaster Recovery.
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 2: Creating Efficient Replication Solutions.
Rajib Kundu Agenda Definitions Failover Cluster Database Snapshots Log shipping Database Mirroring.
Learningcomputer.com SQL Server 2008 – Administration, Maintenance and Job Automation.
IT 456 Seminar 5 Dr Jeffrey A Robinson. Overview of Course Week 1 – Introduction Week 2 – Installation of SQL and management Tools Week 3 - Creating and.
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.
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.
Overview of high availability in Microsoft SQL Server Szymon Wójcik.
Systems Management Server 2.0: Backup and Recovery Overview SMS Recovery Web Site location: Updated.
ATLAS Detector Description Database Vakho Tsulaia University of Pittsburgh 3D workshop, CERN 14-Dec-2004.
7. Replication & HA Objectives –Understand Replication and HA Contents –Standby server –Failover clustering –Virtual server –Cluster –Replication Practicals.
Chapter 15: Achieving High Availability Through Replication.
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.
1 Chapter Overview Defining Operators Creating Jobs Configuring Alerts Creating a Database Maintenance Plan Creating Multiserver Jobs.
Ing. Erick López Ch. M.R.I. Replicación Oracle. What is Replication  Replication is the process of copying and maintaining schema objects in multiple.
Module 5: Implementing Merge Replication. Overview Understanding Merge Replication Architecture Implementing Conflict Resolution Planning and Deploying.
Alwayson Availability Groups
DATABASE REPLICATION DISTRIBUTED DATABASE. O VERVIEW Replication : process of copying and maintaining database object, in multiple database that make.
Course Topics Administering SQL Server 2012 Jump Start 01 | Install and Configure SQL Server04 | Manage Data 02 | Maintain Instances and Databases05 |
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.
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
What HADR Option(s) Are Right For You?. Where’s The AlwaysOn?
William Durkin A Gourmet Menu of SQL Server High Availability Options.
Transactional Replication it’s not scary Evgeny Khabarov.
ROLLING DATABASE SNAPSHOTS David Cobb Daveslog.com.
I/Watch™ Weekly Sales Conference Call Presentation (See next slide for dial-in details) Andrew May Technical Product Manager Dax French Product Specialist.
SQL Database Management
SQL Replication for RCSQL Reporting
Chapter Name Replication and Mobile Databases Transparencies
SQL Replication for RCSQL 4.5
Transactional Replication Deep Dive
Distributed Database Management Systems
Introduction to transactional replication
Navigating the options for Data Redundancy
Disaster Recovery Where to Begin
AlwaysOn Mirroring, Clustering
Getting Started With SQL Server Replication
Transactional replication
Introduction to Replication
Transactional Replication A Deeper Dive Drew Furgiuele, Senior DBA IGS
Disaster Recovery Where to Begin
WHY MOVE TO ASD? Dynamic Scaling Pay-per-usage
Making PowerShell Useful
AlwaysOn Availability Groups
Ch 10. Maintaining and Automating SQL Server
Designing Database Solutions for SQL Server
Presentation transcript:

Glasgow, SQL Server Meetup REPLICATION A guide to SQL Server Replication, how to fix it when it breaks and alternatives to replication. https://uk.linkedin.com/in/johnmccormackdba http://johnmccomack.it John McCormack 13th December 2016 Glasgow, SQL Server Meetup

About me - John McCormack Database administrator at Monster (since 2012). I work mostly with SQL Server 2008R2 - 2012. I do some work with MySQL, although mostly on Amazon RDS. I’ve worked through the various certification exams, ending up as an MCSE: Data Platform. When it comes to SQL Server, I love automating tasks. If I can automate it, I will automate it. Stripping away the mundane tasks opens up time to learn about the interesting ones.

Replication basics Purpose of Replication Replication Architecture Replication is a set of technologies for copying and distributing data and database objects from one database to another and then synchronizing between databases to maintain consistency. [1] Replication Architecture Replication uses the analogy of the publishing industry for each component in replication. There are 4 main types of replication: Snapshot replication Peer to peer replication Merge replication Transactional replication

Replication Architecture Publisher - The source of the data made available for replication. Article - A published object to be replicated including tables, stored procedure, views, indexed views and user-defined-function (UDF). Publication - Articles grouped together into one collection. Distributor - An instance that manages the transmission from publisher to subscriber. Can be local or remote. Subscriber - The destination of the publication. Not restricted to SQL Server. Includes Oracle and IBM DB2. [2] Agent - Agents are required to perform replication related tasks. Usually run as SQL Agent jobs

Types of replication Snapshot - The simplest type of replication. A snapshot is sent to all subscribers and no further changes are recorded. If a new snapshot is created and pushed out, the full subscriber data is overwritten. (No incremental changes) Merge - Starts with a snapshot. Multiple subscription may amend their copy of the data and push back to the publisher. These changes are then replicated to the other subscribers. Conflicts may occur and you need to be able to detect and resolve them. Transactional - starts with a snapshot. Delivers incremental changes to subscriptions in near real time. A log reader agent monitors the transaction log for items marked as for replication and puts these in the distribution database. The distribution agent then sends these changes to the subscriber. Peer to peer - Is built upon transactional replication but each server acts as both a subscriber and a publisher. When data is changed on one node, the other is updated.

Types of agent [3] Snapshot Agent Log Reader Agent Distribution Agent Prepares schema and initial data files Log Reader Agent Used with transactional replication. It moves transactions marked for replication from the transaction log on the Publisher to the distribution database. Distribution Agent The Distribution Agent is used with snapshot replication and transactional replication. It applies the initial snapshot to the Subscriber and moves transactions held in the distribution database to Subscribers.  Merge Agent The Merge Agent is used with merge replication. It applies the initial snapshot to the Subscriber and moves and reconciles incremental data changes that occur.

Troubleshooting Replication Checking for errors Look for errors here first: SELECT * FROM distribution..msrepl_errors ORDER BY ID DESC Replication monitor – “Green is good” Right click Replication, then Launch Replication Monitor Tracer tokens Ideal for confirming everything is fine, but they can take a long time to fail Comparing row counts

Replication Monitor Tip: Right click name of publisher and change or disable refresh rate Green arrow is good Red X means a failure Yellow exclamation means warning, possible latency. Expand publisher for individual publications Click on publication to show: All subscriptions Tracer tokens Agents Warnings

Setting up replication Script is best It guarantees a consistent set up in all environments In event of rebuilding replication, it will be the same GUI is ok at first If you script out for later use

Alternatives to replication Alwayson availability groups Up to 8 secondary databases Backups and reads can be offloaded to secondaries Database Mirroring Marked for deprecation so best to avoid for new implementations Log Shipping Continuous or at set windows Daily restores to secondary server Depending on size and allowable latency

LINKS [1] https://msdn.microsoft.com/en-us/library/ms151198.aspx [2] https://msdn.microsoft.com/en-us/library/ms151195.aspx [3] https://msdn.microsoft.com/en-us/library/ms152501.aspx DEMO