Configure Database Mirroring in SQL Server

Configure Database Mirroring in SQL Server

Learn how to configure database mirroring in SQL server and prerequisites for correct configuration. Database mirroring is a SQL Server high availability solution provided by Microsoft

Database mirroring is a SQL Server high availability solution provided by Microsoft, with the following components.

  1. Principal database server: a source database that you configure for the mirroring.
  2. Mirror database server: a destination database that you must restore with NORECOVERY. Ideally, a mirrored database should be on a separate server.
  3. Witness Server: an optional component that you can set up to configure the mirror with automatic failover.
  4. Endpoint: the communication medium used by the principal and mirror server. The mirror listens on port number 5022; however, you can change it during the configuration.

The Prerequisites to configure the database mirroring are:

  1. Principal and mirror instance must be running on SQL Server 2005 SP1 and later edition.
  2. SQL Server version and edition must be the same on the principal and mirror instance.
  3. Principal and mirror databases must have the same name and database collation. Both databases must be running in the FULL recovery model.
  4. You need to restore a full backup and at least one transaction log backup on the mirrored database. For the mirrored database restore, you must use NORECOVARY.
  5. If you want to configure the automatic failover, then you must set up a witness server. A witness server can be any version of SQL Server. For cost savings, you can use SQL Server Express edition as a witness server.

Now, let’s see it step by step how to configure the database mirror.

sql sql-server database developer

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Introduction to Structured Query Language SQL pdf

SQL stands for Structured Query Language. SQL is a scripting language expected to store, control, and inquiry information put away in social databases. The main manifestation of SQL showed up in 1974, when a gathering in IBM built up the principal model of a social database. The primary business social database was discharged by Relational Software later turning out to be Oracle.

SCHEMAS in SQL Server -MS SQL Server – Zero to Hero Query Master

This is part 3 of “MS SQL Server- Zero to Hero” and in this article, we will be discussing about the SCHEMAS in SQL SERVER. Before getting into this article, please consider to visit previous articles in this series from below.

SQL Server System Databases - Basic Concepts

Understanding various SQL Server system databases and their roles is an excellent aid for managing your SQL Server instance.

How to Make Use of SQL Server Graph Database Features – {coding}Sight

The article provides a thorough guide to SQL Server graph databases with their advantages and downsides, cases of use and useful comparisons. Would SQL Server graph database features fit your next project? While you may not know the definitive answer right now, you might be wondering, “What problems does it solve?”.

Restoring the SQL Server Master Database

It is crucial to back up the SQL Server master database daily. Read to know how to restore the master database to the instance.