Download presentation
Presentation is loading. Please wait.
1
Getting Started With SQL Server Replication
Robert Verell
2
GOLD
3
SILVER BRONZE PERSONAL/BLOG
4
About Me Senior DBA at Cigna-Healthspring since 2011
MCITP 2008 Database Admin @sqlcowbell Sqlcowbell.com/wordpress ONE OF the chapter leaders for NashSUG
5
@SQLCowbell??
6
For Discussion Today Ways to natively copy data
Different types of replication How replication works on the backend Demo setup of transactional replication Demo setup of snapshot replication Adding an article without a full snapshot Demo adding new subscription and changes replicating downstream
7
Ways to Replicate Data (Native)
Backup/Restore SSIS Package/Import-Export Wizard/ETL Log Shipping Mirroring/Availability Groups Replication Triggers? CDC/Service Broker
8
Different Replication Types
Transactional Snapshot Merge Peer to Peer/Bidirectional First let’s look at transactional replication. If you can understand that, snapshot is pretty easy.
9
How Does It Work(components)?
Jonah Jameson is the publisher Paperboy is the distributor People are the subscribers Publisher Distributor Subscribers
10
How Does It Work? Publisher Distributor Subscribers
For the millennials. Publisher Distributor Subscribers
11
Ok, How Does It Do That in SQL Server?
Initial setup – snapshot of articles Distribution Agent applies snapshot THEN, Log Reader Agent reads transaction log Distribution Agent applies changes The snapshot uses BCP in and BCP out – it’s the fastest way to get data from one server to another You can also do a database restore for initial setup of a subscriber
12
Push or Pull? Push Pull If you have a separate distributor
If distributor, publisher, and subscriber are on same inst If your subscriber is under heavy load If distributor and publisher are on same instance If your publisher is under heavy load
13
Replication Restrictions
Primary Key for tables XML Schema collections (snapshot only) Code using WITH ENCRYPTION You can replicate almost any object. But there are some restrictions.
14
Let’s Walk Through Setup
Yes, we’re going to walk through the wizard. We start with distributor setup
15
First you have to configure the distributor
First you have to configure the distributor. So you right click replication and select configure distribution.
20
Now For the Publisher
25
Who can tell me why ChangeTicketJob111 is not selectable?
30
You can run under the agent account but for segregation of duties it’s recommended that you use a sep acct
32
That was easy right? Still got the subscribers
33
Lastly the Subscriber(s)
38
I actually set this up to run under the agent account, so any scripts will be for that setup.
39
You can select “on demand” as well
40
You can also select immediately if you’ve run the snapshot already
41
Let’s See The Rest of This Demo Live
42
You CAN Run Into A Problem Here.
Differentiated by the is_published flag in sys.objects
43
So Thats Transactional
Questions?
44
Let’s Look at Snapshot It’s even easier
47
So Let’s See It in Action
48
Questions On Snapshot Replication
So you came to my session and you already knew all this crap that I’ve showed you. Well, maybe I can introduce you to some newer things!
49
Let’s look at adding an article!
NO FULL SNAPSHOT REQUIRED!!!!
50
One Moar Demo Showing the data replicating; we’ll also add another snapshot
51
Tips For Making it Moar Faster
Multiple publications with larger articles having their own publications Segregate your publisher/distributor/subscriber Replicate Stored Procedures Minimize Transaction size at publisher
52
Some More Advanced Options
AGENT PROFILES So you came to my session and you already knew all this crap that I’ve showed you. Well, maybe I can introduce you to some newer things! DO NOT implement these directly in production. TEST these settings.
53
Agent Profile Settings
-QueryTimeout -BcpBatchSize -MaxBcpThreads -READBATCHSIZE -CommitBatchSize -CommitBatchThreshold -MaxDeliveredTransactions
54
Let’s See What Agent Profiles Look Like
55
That’s It! Questions? Contact: Robert.verell@gmail.com @sqlcowbell
Sqlcowbell.com/wordpress
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.