Book Image

Microsoft SQL Server 2008 High Availability

By : Hemantgiri S. Goswami
Book Image

Microsoft SQL Server 2008 High Availability

By: Hemantgiri S. Goswami

Overview of this book

<p>Every business has it's mission critical applications and data. Therefore, it is very important to keep database servers up and running all the time – 24 X 7. There is a need to store and process terabytes of data to cater for business needs, and it is vital to make data highly available.<br /><br />High availability is all about the site being accessible all the time. High availability solutions minimize the downtime for these mission critical applications.</p> <p>Microsoft SQL Server is a powerful relational database engine, widely used to store and maintain data in Enterprises of various levels be they small, medium or large.</p> <p>This book will teach you how best to use these readily-available options and save you time in making your websites highly available.<br /><br />This Microsoft SQL Server 2008 High Availability book will take you through pre and post installation concepts and common issues you come across while working with SQL Server HA. It will teach you how these various HA solutions can be installed using GUI and the command line. It will also show you how to troubleshoot common issues you may encounter whilst installing or managing the HA option in your environment. It provides references to external links for more advanced learning on the topic.<br /><br />This book starts with an introductory chapter into the windows domain, domain users and various handshake methods available with Windows server. It also offers information the different authentication methods available with SQL Server - giving you an insight into the importance of security. After you are through with the security aspects, your journey to installing SQL Server HA will start. It will cover the concepts of database mirroring, log shipping, clustering, and replication.<br /><br />By the end of this book you will be confident enough to take up the challenge to install any of the SQL Server HA options.</p>
Table of Contents (18 chapters)
Microsoft SQL Server 2008 High Availability
Credits
Foreword
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface

Configuration using T-SQL


We have seen how to install Database Mirroring using the wizard. It's now time to see Database Mirroring installation using T-SQL code.

  1. 1. The first step is to create an endpoint and a listener port on the Principal Server.

  2. 2. The next step is to create the endpoint and listener port on the Mirror instance. To do so, execute the following code on the Mirror server:

  3. 3. We will now create a partner for the database that we want to be part of the Database Mirroring setup. Execute the code shown in the next screenshot into the Mirror server to establish the Mirroring session:

  4. 4. In the next step, we will create a partnership for the Mirror server, by executing the code shown in the following screenshot:

  5. 5. To failover using the T-SQL command, execute the following command, and it will initiate failover:

    Note

    Automatic failover is an enterprise-specific feature and will be available when we have included the Witness Server. The Witness Server does the work of monitoring...