Home » Database Mirroring » Important Things to Consider When Setting Up Database Mirroring In SQL Server

Important Things to Consider When Setting Up Database Mirroring In SQL Server

👤 Andrew Jackson | Modified: May 5th, 2023|Database Mirroring | 4 Minutes Reading

When properly and fully configured, the mirroring system enables high availability of the database. However, when studied in detail a number of other factors are also associated with it that are important to be considered before one implement the usage of mirroring as a solution to their condition. Amongst the number of factors involved, some are related to server environment, bandwidth consumption by the network, workload intensity, and more.

Removal of the feature in the future releases of the SQL Server was decided beforehand. Therefore, it is suggested not to deploy the practice in later versions and plan accordingly to modify the applications that are continuing the practice of this feature.

TIP: Making use of AlwaysOn Availability Group is rather suggested over choosing mirroring services.

Requirements for Mirroring

  • Partners and witnesses, if available should be setup and functioning on a common Server version.
  • Principal and mirroring server should be operating on the same SQL version.
  • Database should be using full recovery model. Bulk logged and simple recovery models aren’t supporting to database mirroring.
  • Check whether the mirror server is having enough storage capacity for the mirrored database.
  • In case the mirroring of database stops in between, apply the log backup, if any taken subsequently during the mirroring.

NOTE: You do have the option to upgrade server instance that are part of the mirroring procedure as partners into latest editions of the Server.

LIMITATIONS

There are certain limitations that are associated to SQL Server database mirroring which the administrator/user must be aware:

  • Only database of the user can be mirrored. Master, tempdb, model, or msdb are the databases that cannot be mirrored.
  • It is not possible to rename a mirrored copy of your database while it is being generated (is in process of being mirrored).
  • Database mirroring procedure cannot be setup for the database having FILESTREAM filegroups.
  • Only 10 databases can be mirrored at a time by each server instance on a 32-bit machine.

Recommendations To Be Considered

When deploying database mirroring, it is observed that optimal output with regard to the performance ratio is obtained by applying asynchronous operation to use. A session of database mirroring that uses synchronous technique is said to experience slowed down output as a result of the large numbers in which transact log files are created due to workload.

Following guidelines are therefore should be implemented and considered before deploying database mirroring:

1. Start the procedure of mirroring in asynchronous and high performance mode. The mode has a benefit over all the rest, i.e. it is the least sensitive ones to the network environment. Thus, it provides finest configuration for studying the working of mirroring procedure. Asynchronous procedure is advised until you are completely sure about your bandwidth supporting mirroring. In addition, one must have the understanding about mirroring setup.

2. When you fully understand and see the results for yourself that asynchronous mirroring technique is working out for your business needs, you could use it for improving your data security measures too. Once this works out for you, try applying high safety mode without the inclusion of automatic failover. The only purpose of testing this procedure is to examine whether synchronous operation affects the performance of your database or not.

3. Check enabling automatic failover until you are sure that the above-suggested mode without it is best suited for meeting your business needs. If so, then also check that no failures are caused by the network errors.

NOTE: It is important to keep a tab on the network related error messages that may appear during the mirroring session causing it to fail the procedure.

Conclusion: Most of the things to consider when setting up database mirroring in SQL server have been specified above. Most importantly, the fact that procedures more advanced than mirroring have been introduced is what makes the decision making slightly difficult. Therefore, it is best for you to apply the suggested guidelines when implementing the mirroring procedure for replication of your server’s user database for security reasons. Being one of the most known and implemented procedure it has not only been suggested by experts but also taken into consideration by most administrators.