Access this page from the principal database, and use it to configure and to modify the properties of database mirroring for a database. Also use it to launch the Configure Database Mirroring Security Wizard, to view the status of a mirroring session, and to pause or remove the database mirroring session.
Security must be configured before you can start mirroring. If mirroring has not been started, you must begin by using the wizard. The Mirroring page textboxes are disabled until the wizard has been finished.
To configure database mirroring by using SQL Server Management Studio
Click this button to launch the Configure Database Mirroring Security Wizard.
If the wizard completes successfully, the action taken depends on whether mirroring has already begun, as follows:
If mirroring has not begun.
The property page caches that connection information and, also, caches a value that indicates whether the mirror database has the partner property set.
At the end of the wizard, you are prompted to start database mirroring using the default server network addresses and operating mode. If you need to change the addresses or operating mode, click Do Not Start Mirroring.
If mirroring has begun.
If the witness server was changed in the wizard, it is set accordingly.
Server network addresses
An equivalent option exists for each of the server instances: Principal, Mirror, and Witness.
The server network addresses of the server instances are specified automatically when you complete the Configure Database Mirroring Security Wizard. After completing the wizard, you can modify the network addresses manually, if necessary.
The server network address has the following basic syntax:
fully_qualified_domain_name is the server on which the server instance exists.
port is the port assigned to the database mirroring endpoint of the server instance.
To participate in database mirroring, a server requires a database mirroring endpoint. When you use the Configure Database Mirroring Security Wizard to establish the first mirroring session for a server instance, the wizard automatically creates the endpoint and configures it to use Windows Authentication. For information about how to use the wizard with certificate-based authentication, see How to: Configure a Database Mirroring Session (SQL Server Management Studio).
Each server instance requires one and only one database mirroring endpoint, regardless of the number of mirroring session to be supported.
For example, for a server instance on a computer system named DBSERVER9 whose endpoint uses port 7022, the network address might be:
During a database mirroring session the principal and mirror server instances cannot be changed; the witness server instance, however, can be changed during a session. For more information, see "Remarks," later in this topic.
Click to begin mirroring, when all of the following conditions exist:
The TCP addresses of the principal and mirror server instances are already specified (in the Server network addresses section).
If the operating mode is set to high safety with automatic failover (synchronous), the TCP address of the mirror server instance is also specified.
Security has been configured correctly.
Click Start Mirroring to initiate the session. The Database Engine attempts to automatically connect to the mirroring partner to verify that the mirror server is correctly configured and begin the mirroring session. If mirroring can be started, a job is created to monitor the database.
Pause or Resume
During a database mirroring session, click Pause to pause the session. A prompt asks for confirmation; if you click Yes, the session is paused, and the button changes to Resume. To resume the session, click Resume.
Following a forced service, when the original principal server reconnects, mirroring is suspended. Resuming mirroring in this situation could possibly cause data loss on the original principal server. For information about how to manage the potential data loss, see Forced Service (with Possible Data Loss).
On the principal server instance, click to stop the session and remove the mirroring configuration from the databases. A prompt asks for confirmation; if you click Yes, the session is stopped and mirroring is removed. For information about the impact of removing database mirroring, see Removing Database Mirroring.
If this is the only mirrored database on the server instance, the monitor job is removed.
Click to fail over the principal database to the mirror database manually.
If the mirroring session is running in high-performance mode, manual failover is not supported. To fail over manually, you must first change the operating mode to High safety without automatic failover (synchronous). After failover completes, you can change the mode back to High performance (asynchronous) on the new principal server instance.
A prompt asks for confirmation. If you click Yes, failover is attempted. The principal server begins by trying to connect to the mirror server by using Windows Authentication. If Windows Authentication does not work, the principal server displays the Connect to Server dialog box. If the mirror server uses SQL Server Authentication, select SQL Server Authentication in the Authentication box. In the Login text box, specify the login account to connect with on the mirror server, and in the Password text box, specify the password for that account.
If failover succeeds, the Database Properties dialog box closes. The principal and mirror server roles are switched: the former mirror database becomes the principal database, and vice versa. Note that the Database Properties dialog box becomes unavailable on the old principal database immediately because it has become the mirror database; this dialog box will become available on the new principal database after failover.
If failover fails, an error message is displayed, and the dialog box remains open.
If you click Failover after modifying properties in the Database Properties dialog box, those changes are lost. To save your current changes, answer No to the confirmation prompt, and click OK to save your changes. Then, reopen the database properties dialog box and click Failover.
Optionally, change the operating mode. The availability of certain operating modes depends on whether you have specified a TCP address for a witness. The options are as follows:
High performance (asynchronous)
Null (if exists, not used but the session requires a quorum)
To maximize performance, the mirror database always lags somewhat behind the principal database, never quite catching up. However, the gap between the databases is typically small. The loss of a partner has the following effect:
If the mirror server instance becomes unavailable, the principal continues.
If the principal server instance becomes unavailable, the mirror stops. But if the session has no witness (as recommended) or the witness is connected to the mirror server, the mirror server remains accessible as a warm standby; the database owner can force service to the mirror server instance (with possible data loss).
Maximized availability by including a witness server instance to support automatic failover. Note that you can select the High safety with automatic failover (synchronous) option only if you have first specified a witness server address.
Manual failover is possible whenever the partners are connected to each other.
After mirroring begins, the Status panel displays the status of the database mirroring session as of when you selected the Mirroring page. To update the Status panel, click the Refresh button. The possible states are as follows:
This database has not been configured for mirroring
No database mirroring session exists and there is no activity to report on the Mirroring page.
The principal database is available but is not sending any logs to the mirror server.
The principal server instance cannot connect to its partner.
The contents of the mirror database are lagging behind the contents of the principal database. The principal server instance is sending log records to the mirror server instance, which is applying the changes to the mirror database to roll it forward.
At the start of a database mirroring session, the mirror and principal databases are in this state.
On the principal server instance, a manual failover (role switching) has begun, and the server is currently transitioning into the mirror role. In this state, user connections to the principal database are terminated quickly, and the database takes over the mirror role soon thereafter.
When the mirror server becomes sufficiently caught up to the principal server, the database state changes to Synchronized. The database remains in this state as long as the principal server continues to send changes to the mirror server and the mirror server continues to apply changes to the mirror database.
For high-safety mode, failover is possible, without any data loss.
For high-performance mode, some data loss is always possible, even in the Synchronized state.
You can add a witness to an existing session or replace an existing witness. If you know the server network address of the witness, you can enter it into the Witness field manually. If you do not know the server network address of the witness, use Configure Database Mirroring Security Wizard to configure the witness. After the address is in the field, make sure that the High-safety with automatic failover (synchronous) option is selected.
After you configure a new witness, you must click Ok to add it to the mirroring session.
To add a witness when using Windows Authentication
To remove a witness, delete its server network address from the Witness field. If you switch from high-safety mode with automatic failover to high-performance mode, the Witness field is automatically cleared.
After deleting the witness, you must click Ok to remove it from the mirroring session.
Monitoring Database Mirroring
To monitor the mirrored databases on a server instance, you can use either the Database Mirroring Monitor or the sp_dbmmonitorresults system stored procedure.