0% found this document useful (0 votes)
4 views41 pages

Transactional Replication - Beyond The Basics

The session on Transactional Replication aims to provide an understanding of its fundamentals, advanced monitoring techniques, performance tuning, and troubleshooting common issues. Led by Kendal Van Dyke, a SQL Server DBA with over a decade of experience, the agenda covers mechanics, configuration, monitoring, tuning, and troubleshooting. Participants will also gain insights into various replication topologies and receive resources for further learning.

Uploaded by

anishraj1990
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views41 pages

Transactional Replication - Beyond The Basics

The session on Transactional Replication aims to provide an understanding of its fundamentals, advanced monitoring techniques, performance tuning, and troubleshooting common issues. Led by Kendal Van Dyke, a SQL Server DBA with over a decade of experience, the agenda covers mechanics, configuration, monitoring, tuning, and troubleshooting. Participants will also gain insights into various replication topologies and receive resources for further learning.

Uploaded by

anishraj1990
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 41

Transactional Replication:

Beyond The Basics


Spotlight Session – 90 mins
Kendal Van Dyke
Session Goals
• Understand transactional replication
fundamentals

• Learn advanced monitoring techniques

• Learn how to tune replication performance

• Learn how to troubleshoot and fix common


problems

DBA390S • Transactional Replication


About Me
• SQL Server DBA 10+ years
• 7 years experience w\ multi-datacenter, high
volume transactional replication

Blog: http://www.kendalvandyke.com
Twitter: @SQLDBA
LinkedIn: http://linkedin.com/in/kendalvandyke

DBA390S • Transactional Replication


Agenda
• Mechanics
• Configuration
• Monitoring
• Tuning
• Troubleshooting
• Q&A

DBA390S • Transactional Replication


Photo Licensed With Creative Commons From http://www.flickr.com/photos/elsie/8229790/
DBA390S • Transactional Replication
Mechanics
Vernacular

Publisher • Source of data to be replicated to other servers

Publication • Collection of articles in a database on publisher

Article • Object to be replicated

• Point-in-time copy of the schema and data for


Snapshot articles in a publication

Subscriber • Instance which receives replicated data

• Stores all data changes to be replicated between


Distributor publishers & subscribers in a distribution database

• Performs replication related tasks (e.g.delivering


Agent changes to subscribers)

DBA390S • Transactional Replication


Topologies: Central Publisher

Subscriber

Publisher Distributor

Subscriber

DBA390S • Transactional Replication


Topologies: Central Subscriber

Publisher Distributor

Subscriber

Publisher Distributor

DBA390S • Transactional Replication


Topologies: Republishing Subscriber

Subscriber

Publisher Distributor Subscriber\ Distributor


Publisher

Subscriber

DBA390S • Transactional Replication


Snapshot Process

Snapshot Files

Snapshot Dist.
Agent Agent
snapshot.exe distrib.exe
distribution

Publisher Distributor Subscriber

DBA390S • Transactional Replication


Command Delivery

Cleanup
Agents
(SQL Jobs)

Log
Distrib.
Reader
Agent
Agent distrib.exe
logread.exe distribution
Transaction
Log

Publisher Distributor Subscriber

DBA390S • Transactional Replication


Photo Licensed With Creative Commons From http://www.flickr.com/photos/amulligan/266151892/
Configuration

DBA390S • Transactional Replication


What Can Be Replicated
• Tables
• Stored Procedures (Definition & Execution)
• User Defined Functions (Definition)
• Views (Definition)
• Indexed Views (Definition)
• Indexed Views (As Table)
• DDL Commands

DBA390S • Transactional Replication


Publications
• Article properties
• Article filters
• Schema changes
• Synchronization mode
• Recovery model

DBA390S • Transactional Replication


Subscriptions
• Push vs. Pull
• Push = Distribution agent runs on distributor
• Pull = Distribution agent runs on subscriber

• Synchronization Types
• „none‟ (deprecated)
• „automatic‟ (default)
• „replication support only‟
• „initialize with backup‟

DBA390S • Transactional Replication


Photo Licensed With Creative Commons From http://www.flickr.com/photos/speshulted/438580934/
DBA390S • Transactional Replication
Monitoring
Replication Monitor

DBA390S • Transactional Replication


Tracer Tokens

DBA390S • Transactional Replication


Alerts

DBA390S • Transactional Replication


Alerts

DBA390S • Transactional Replication


System Stored Procedures
• Run At Publisher
• sp_helppublication
• sp_helparticle
• sp_replcounters

DBA390S • Transactional Replication


System Stored Procedures
• Run At Distributor
• SQL 2000 and up
• sp_MSenum_snapshot
• sp_MSenum_logreader
• sp_MSenum_distribution

• SQL 2005 and up


• sp_replmonitorhelppublisher
• sp_replmonitorhelppublication
• sp_replmonitorhelpsubscription
• sp_replmonitorsubscriptionpendingcmds

DBA390S • Transactional Replication


Perfmon Counters
• SQLServer: Replication Agents
• SQLServer: Replication Dist.
• SQLServer: Replication Logreader
• SQLServer: Replication Snapshot

DBA390S • Transactional Replication


Distribution DB – Tables of interest
• Configuration
• MSarticles
• MSpublications
• MSsubscriptions
• MSagent_profiles
• MSdistribution_agents
• MSlogreader_agents
• History
• MSdistribution_history
• MSlogreader_history

DBA390S • Transactional Replication


Custom Queries
• Publications, Articles, & Subscriptions
• Agent profiles by subscriber
• Log Reader Volume
• Distribution Agent Volume

DBA390S • Transactional Replication


Photo Licensed With Creative Commons From http://www.flickr.com/photos/purecaffeine/302682456/
DBA390S • Transactional Replication
Tuning
Agents
• Delivery Schedule
• Profiles

DBA390S • Transactional Replication


SubscriptionStreams

DBA390S • Transactional Replication


Output Logging

DBA390S • Transactional Replication


Distribution DB
• Physical Location
• Command Retention
• Duplicate Articles
• Partial Subscriptions

DBA390S • Transactional Replication


Photo Licensed With Creative Commons From http://www.flickr.com/photos/joebeone/292531498/
Troubleshooting

DBA390S • Transactional Replication


Data Consistency Errors

“The row was not found at the Subscriber when


applying the replicated command”

Solution:
• Set distribution agent to continue on data consistency
errors …or…
• Use sp_browsereplcmds to view failing command and
fix accordingly

DBA390S • Transactional Replication


Missing Objects

“Could not find stored procedure „spMSins_...”

Solution:
• Use sp_scriptpublicationcustomprocs to
generate stored procedures for publication

DBA390S • Transactional Replication


Nothing’s Happening…

Distribution agents won‟t start or don‟t appear to do


anything

Solution:
• Possible issue with non-interactive desktop heap
• Requires registry change
• Microsoft KB article 824422

DBA390S • Transactional Replication


Timeouts & Retries

Snapshot agent cannot complete or distribution


agents frequently retry

Solution:
• Possible network issue – check speed and duplex on
network cards for publisher, distributor, & subscriber

DBA390S • Transactional Replication


Everything’s Behind

All subscriptions show the same latency value

Solution:
• Log Reader Agent may be behind. Use DBCC commands
to view transaction log status on publisher
• DBCC SQLPERF(logspace)
• DBCC LOGINFO

DBA390S • Transactional Replication


I Said NOT To Replicate Deletes!

Delete commands replicate even though they were


set not to

• Solution:
• Management Studio UI bug
• Script publication
• Verify @del_cmd = N’NONE’

DBA390S • Transactional Replication


Additional Resources
Books
• Books Online
• Pro SQL Server 2008 Replication, Sujoy Paul
Forums
• MSDN
• SQL Server Central
Websites & Blogs
• http://blogs.msdn.com/b/repltalk
• http://kendalvandyke.blogspot.com
• http://www.replicationanswers.com
Twitter - #sqlhelp

DBA390S • Transactional Replication


Photo Licensed With Creative Commons From http://www.flickr.com/photos/lwr/12364944/
Questions?

DBA390S • Transactional Replication


Complete the Evaluation Form to Win!
Win a Dell Mini Netbook – every day – just for handing in
your completed form. Each session evaluation form
represents a chance to win.
Pick up your evaluation form:
• In each presentation room
• At the PASS Booth near registration

Drop off your completed form:


Sponsored by Dell
• Near the exit of each presentation room
• At the PASS Booth near registration

DBA390S • Transactional Replication


Thank you
for attending this session and the
2010 PASS Summit in Seattle

You might also like