O'Reilly logo

Microsoft® SQL Server 2012 Unleashed by Alex T. Silverstein, Chris Gallelli, Paul T. Bertucci, Ray Rankins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating the Database on the Mirror Server

When the endpoints are configured and roles are established, you can create the database on the mirror server and get it to the point of being able to mirror. You must first make a backup copy of the principal database (AdventureWorks2012, in this example). This backup will be used to create the database on the mirror server. You can use SSMS tasks or use SQL scripts to do this. The SQL scripts (DBBackupAW2012.sql), which are easily repeatable, are used here.

On the principal server, you make a complete backup as follows:

BACKUP DATABASE [AdventureWorks2012]    TO DISK = N'C:\Program Files\Microsoft SQLServer\MSSQL11.SQL2012DXD01\MSSQL\Backup\AdventureWorks4Mirror.bak'

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required