Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Professional SQL Server High Availability and Disaster Recovery

You're reading from   Professional SQL Server High Availability and Disaster Recovery Implement tried-and-true high availability and disaster recovery solutions with SQL Server

Arrow left icon
Product type Paperback
Published in Jan 2019
Publisher Packt
ISBN-13 9781789802597
Length 564 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Author (1):
Arrow left icon
Ahmad Osama Ahmad Osama
Author Profile Icon Ahmad Osama
Ahmad Osama
Arrow right icon
View More author details
Toc

Table of Contents (9) Chapters Close

Professional SQL Server High Availability and Disaster Recovery
Preface
1. Getting Started with SQL Server HA and DR 2. Transactional Replication FREE CHAPTER 3. Monitoring Transactional Replication 4. AlwaysOn Availability Groups 5. Managing AlwaysOn Availability Groups 6. Configuring and Managing Log Shipping Appendix

Lesson 2: Transactional Replication


Activity 2: Configuring Transactional Replication

Solution:

  1. Navigate to C:\Code\Lesson02\Activity and open RemoveReplication.sql in SQL Server Management Studio. Modify the parameter values, as instructed in the script, and execute the script.

    This will remove the existing publication and subscription for the AdventureWorks database.

    This step is only to be executed if there is an existing publication and subscription for the AdventureWorks database.

  2. Execute the following query to drop and create the AdventureWorks database at the subscriber:

    DROP DATABASE AdventureWorks
    GO
    CREATE DATABASE AdventureWorks
  3. Execute the C:\Code\Lesson02\Activity\1_CreatePublication.sql query in SQLCMD mode to create the Pub-AdventureWorks publication and add articles to the publication.

    You'll have to modify the publisher and subscriber parameter values as per your environment.

  4. Execute the C:\Code\Lesson02\Activity\2_CreateSubscription.sql query in SQLCMD mode to create the Pub-AdventureWorks subscription.

    You'll have to modify the publisher and subscriber parameter values as per your environment.

  5. Execute the C:\Code\Lesson02\Activity\3_VerifyReplication.sql query to verify that the replication has been configured successfully.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image