- Principal Instance - Put the database you want to mirror in FULL recovery mode.
1: BACKUP DATABASE AdventureWorksLT2008
2: TO DISK = 'c:\AdventureWorksLT2008.bak'
4: BACKUP LOG AdventureWorksLT2008
5: TO DISK = 'c:\AdventureWorksLT2008.trn'
- Copy the backups you made on the Principal Instance to the Mirror Instance
- Mirror Instance - Restore the database and log with the NORECOVERY option
1: RESTORE Database AdventureWorksLT2008
2: FROM DISK = 'c:\AdventureWorksLT2008.bak'
3: WITH MOVE 'AdventureWorksLT2008_Data' TO 'E:\MSSQL10.MSSQLSERVER\MSSQL\DATA\AdventureWorksLT2008.mdf',
4: MOVE 'AdventureWorksLT2008_Log' TO 'E:\MSSQL10.MSSQLSERVER\MSSQL\DATA\AdventureWorksLT2008.ldf',
7: RESTORE LOG AdventureWorksLT2008
8: FROM DISK = 'c:\AdventureWorksLT2008.trn'
9: WITH NORECOVERY
- On the Principal Instance right click on the database you are going to mirror and select Tasks > Mirror...
- Click on the Configure Security... button. This will launch the Configure Database Mirroring Security Wizard.
- Click the Next button on the initial screen. On the Include Witness Server dialog select No
- On the Principal Server Instance dialog leave the default and click Next
- On the Mirror Server Instance dialog enter in the name of the server where you will be mirroring to. Click the Connect... button. Leave the port and endpoint name with the defaults and click on the Next button.
- Enter in the names of the accounts used to mirror the data. Since we have a domain I would recommend leaving these boxes empty. Click the Finish button.
- If everything goes well you should see a dialog box documenting the different endpoints and mirroring configuration. Click on the Do Not Start Mirroring Button. This way we can review the settings before we start mirroring.
- Change the operating mode to High performance (asynchronous)
- Click on the Start Mirroring Button. After a few moments you should see the status change to "Synchronized"