SQL Server 2005, compared to SQL Server 2000来, says that there is a considerable improvement in performance and functionality, even the "revolution" to describe the upgrade. SQL Server 2005 makes SQL Server the top tier of enterprise databases. For data high availability, SQL Server 2005 provides users with data mirroring, replication, failover clustering, and log shipping capabilities. This article simply interfaces the SQL Server 2005 mirroring feature to the reader.
A brief introduction of mirroring
Database mirroring is a high-availability software solution that provides clients with less than 10 seconds of failover. Each database mirroring configuration contains a principal server (including the principal database), a mirrored server (with a mirrored database), and a witness server, where the witness is optional. The principal server and mirror server requirements are separate server instances. The role of the principal and mirror servers is relative, and you can automatically or manually set the principal server as the mirror server and the mirror server as the principal server. Unlike the principal and mirror servers, the witness is not available for the database. The witness monitors the principal server and the mirror server, ensuring that there are and only one of these failover servers within a given time as the principal server, thereby supporting automatic failover. If a witness is present, the synchronization session will run in high availability mode, and if the principal server fails, automatic failover can occur. If the witness does not exist, the synchronization session will run in high level protection mode, a failure requires manual failover, and data loss may occur.
Figure 1: Two server mirrors
Figure 2: Two server mirrors, one witness
When the database is ready to finish, the endpoint is created and the user can enable database mirroring. Once the mirror is started, each partner will begin to maintain state information about its database in the database, as well as another partner and witness. These state information allows the server instance to maintain the current relationship called the database mirroring session. During a database mirroring session, the server instance will monitor each other by exchanging PING messages periodically with each other.