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'

Get Microsoft® SQL Server 2012 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.