What is a mirrored database?

What is a mirrored database?

A mirror database is a backup copy created on another server to ensure continuous data availability and avoid downtime. With database mirroring, copies of a single database reside on different computers called server instances, typically remote from each other.

Why do we mirror database?

Database Mirroring is used to move the database transactions from one SQL Server database (Principal database) to another SQL Server database (Mirror database) on a different instance. In SQL Server Log Shipping and Mirroring can work together to provide solutions for high availability and disaster recovery.

What do you need to know about Database mirroring?

mirror server. In a database mirroring configuration, the server instance on which the mirror database resides. principal database. In database mirroring, a read-write database whose transaction log records are applied to a read-only copy of the database (a mirror database).

Do you have to run the same SQL Server as the mirror server?

The mirror server instance must be running the same edition of SQL Server. A database mirroring session runs with either synchronous or asynchronous operation. Under asynchronous operation, the transactions commit without waiting for the mirror server to write the log to disk, which maximizes performance.

Who is the principal server in database mirroring?

In database mirroring, the partner whose database is currently the principal database. Received transaction log records that are waiting on the disk of a mirror server. The principal server and mirror server perform complementary principal and mirror roles. Optionally, the role of witness is performed by a third server instance.

How does role switching work in database mirroring?

Within the context of a database mirroring session, the principal and mirror roles are typically interchangeable in a process known as role switching. Role switching involves transferring the principal role to the mirror server.