Welcome to the blog site of SQLServer.in

Database Mirroring step by step

Here is the detailed step by step implementation of Database Mirroring with screen shots. Note that I have shown here is a High Protection Mirroring scenario.

Here we are setting up a synchronous operating mode.

 

Step 1

 

Create MirrorDB in the source database (called as Principal database), for which we are going to start mirroring.

 

mirror1

 

 

mirror2

Step 2 

 

Create a backup of the MirrorDB in the source SQL Server (Principal database) & restore it in the destination server with the same name. Make sure to restore the database with NORECOVERY. The destination server MirrorDB is called as Mirror database.

 

mirror3

 

mirror4

 

 

 

 

mirror5

 

mirror6

 

mirror7

 

mirror9

  

Step 3

 

As shown in the below screen, right click on the database, select properties & select Mirroring. Select Configure Security to configure mirroring for the required database.

Follow the screen shots as given below.

 

 Note that here I do not have a Witness server, & hence select “NO” for include Witness server option.

  mirror10

 mirror11

mirror12

 mirror13

Step 4

Select the Mirror Server Instance as shown below & click connect. Here we have to specify the destination, i.e. Mirror database server’s credentials to connect.

 mirror14

Step 5

Leave service accounts for both Principal & Mirror blank, follow the remaining screen shots.

mirror15

mirror16

mirror17

Step 6 

Click on Start Mirroring to start the mirroring from Principal database to Mirror database.

  mirror18

Step 7

 

As you can see in the below screen shot, the status is, the databases are fully Synchronized.

mirror19

Step 8  

The MirrorDB in the source server is now marked as Principal, Synchronized.

mirror20

 

Step 9  

The MirrorDB in the destination server is now marked as Mirror, Synchronized (Restoring)

mirror21

 

Step 10

 

You can do manual failover as shown below, by selecting Failover option.

mirror22

mirror23b

Step 11

 

The Principal database is now changed to Mirror & the Mirror is changed to Principal as shown in the below screen shots.

mirror23

mirror24

Mirroring is a simple process & if failed we can easily reset it up, by restoring the latest backup of the source in the destination & reconfigure Mirroring.

2 Comments

  1. by ArunKumar, on November 22 2010 @ 11:21 am

     

    Tkz for your wonderful share….

  2. by trived, on May 9 2011 @ 9:54 am

     

    good

Comment RSS

Get Adobe Flash playerPlugin by wpburn.com wordpress themes
 

About Author

Krishna is a Senior Database Administrator, having handson experience of 6 years. Areas of expertise includes database engine, Business Intelligence & performance tunning. A regular SQL blogger on his own website, msdn forums, sqlteam.com & believe in sharing his experience with other technology enthusiasts.