Configure Database Mirroring

  1. On the Principal SQL Server, open SMSS, right-click the database from the Object Explorer, select Tasks then select Backup Database Window appears. Now select appropriate database from the Source drop-down menu

  2. Select Full from the Backup Type drop-down menu

  3. Select the Backup File Path. Then Save with <file-name>.bak extension, click OK

tmpwwtby4ss.png

Figure 6: Back Up Database window

  1. Similarly, select the same database. Right-Click and select Tasks and then select Restore Database

  2. Select Transactional Log from the Backup Type drop-down menu

  3. Select the Backup File Path then Save with <file-name>.trn extension , click OK

  4. Now, copy the Backup files to the Mirror SQL Server. Restore the database on the Mirror SQL Server

  5. On the Mirror SQL Server, open SMSS, Right-Click on the Database and select Restore Database

  6. Select the Device radio button and select the new created Backup Files

  7. Select the Options and select the RESTORE with NO RECOVERY from the Recovery State drop-down menu, click OK

This will restore the database from the Principal SQL Server to the Mirror SQL Server.

  1. On the Principal SQL Server, select the same database. Right-Click and select Tasks and then select Mirror Database

  2. Configure Database Mirroring Security wizard appears. Click Next for another two wizards

  3. Select Witness Server checkbox

  4. Now Click Next on the Principal SQL Server wizard

tmpnmjuvfvi.jpg

Figure 7: Configuring Database Mirroring Security Wizard

  1. Select the Mirror server instance from the drop-down menu, click Connect and click Next

tmpdhxihja_.png

Figure 8: Configuring Database Mirroring Security Wizard

  1. Select the Witness server instance from the drop-down menu, click Connect and click Next

tmpw7srqhvw.png

Figure 9: Configuring Database Mirroring Security Wizard

  1. Enter the Domain Admin Account for Principal, Witness and Mirror Instance. Click Next

tmpsqfj4bq7.png

Figure 10: Configuring Database Mirroring Security Wizard

  1. Verify the details, click Finish

  2. Database Properties pop-up appears, select Start Mirroring

tmprz_w8e0f.png

Figure 11: Database Properties Wizard

  1. This might take few seconds, once done the below shown window is seen

tmp5kxexkht.jpg

Figure 12: Database Properties Wizard

  1. On the Principal SQL Server expand the Databases and Locate the appropriate database, which shows Principal, Synchronizing after its name

tmpm6xyvs4k.jpg

Figure 13: Database Properties Wizard

  1. Similarly, on Mirror SQL Server expand the Databases and Locate the appropriate database, which shows Mirror, Synchronized/Restoring after its name

tmpfdbkrtdv.jpg

Figure 14: Database Properties Wizard