Book Image

Professional SQL Server High Availability and Disaster Recovery

By : Ahmad Osama
Book Image

Professional SQL Server High Availability and Disaster Recovery

By: Ahmad Osama

Overview of this book

Professional SQL Server High Availability and Disaster Recovery explains the high availability and disaster recovery technologies available in SQL Server: Replication, AlwaysOn, and Log Shipping. You’ll learn what they are, how to monitor them, and how to troubleshoot any related problems. You will be introduced to the availability groups of AlwaysOn and learn how to configure them to extend your database mirroring. Through this book, you will be able to explore the technical implementations of high availability and disaster recovery technologies that you can use when you create a highly available infrastructure, including hybrid topologies. Note that this course does not cover SQL Server Failover Cluster Installation with shared storage. By the end of the book, you’ll be equipped with all that you need to know to develop robust and high performance infrastructure.
Table of Contents (9 chapters)
Professional SQL Server High Availability and Disaster Recovery
Preface

Configuring Transactional Replication


We'll now look at how to configure or set up transactional replication between two databases using T-SQL.

Exercise 7: Creating the Publication

The first step in configuring replication is to create the publication. Follow these steps to create a publication for transactional replication:

  1. Navigate to C:\Code\Lesson02\Transactional and open 1_CreatePublication.sql in SQL Server Management Studio.

  2. In SSMS, from the top menu, select Query and then select SQLCMD. This changes the mode of the 1_CreatePublication.sql query to SQLCMD from SQL.

  3. Modify the parameters in the script (shown in the following screenshot) as per your environment:

    Figure 2.2: Parameters in creating a publication

    The preceding screenshot shows the parameters being used in the script. The parameters are self-explanatory. The publisher and distributor are the same, as the publisher acts as its own distributor.

  4. To run the script and create the publication, change the parameters as specified earlier...