0% found this document useful (0 votes)
59 views3 pages

Mirroring

This document provides steps to set up database mirroring between two SQL Server instances: 1. Take a full backup and transaction log backup of the database on the main instance. Restore the backup on the mirror instance with no recovery. 2. On the main instance, right click the database and select "Mirror" to launch the mirroring wizard. Configure security, select the principal and mirror servers, and select a service account. 3. Potential errors can be fixed by configuring the login accounts for the SQL Server services on both instances through SQL Server Configuration Manager. 4. Once configured, mirroring will start synchronizing the database between the two servers.

Uploaded by

abdul moiz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views3 pages

Mirroring

This document provides steps to set up database mirroring between two SQL Server instances: 1. Take a full backup and transaction log backup of the database on the main instance. Restore the backup on the mirror instance with no recovery. 2. On the main instance, right click the database and select "Mirror" to launch the mirroring wizard. Configure security, select the principal and mirror servers, and select a service account. 3. Potential errors can be fixed by configuring the login accounts for the SQL Server services on both instances through SQL Server Configuration Manager. 4. Once configured, mirroring will start synchronizing the database between the two servers.

Uploaded by

abdul moiz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

MIRRORING

Taking Backup and Transactional Log Backup


• Open SQL Mgt. Studio
• connect to main SQL instance
• click on “+” to expend Databases
• right-click on your database i.e. EmployeeDB (or whatever you named it).
• click on Task from menu, then click on Backup
• Backup window will appear,
• select backup type to Full,
• set stored location
• et backup file name with “.bak” extension.
• Click on Media options,
• in Overwrites media options section, select “overwrites all ….”
• in reliability section, click on “verify backup….” option.
• click on OK to create backup
• Repeat steps from 4 to 8 for taking backup of transactional log.

Restoring Database from Backup File


• Connect to second SQL instance
• click on “+” to expend Databases
(make sure that the database you are going to restoring from backup file is should not already exist)

• right-click on “Databases”, then click on Restore Database


• Restore Database window will appear
• in the source section,
• click on device then click on “….” icon/button to locate your backup files.
• Click on “File” from the left menu,
• in “restore database file as” section, set destination file location as to your
mirror/second instance data file path.
(if source and destination file location are same it will error)

• Click on “Options” from the left menu,


• in “restore options” select “Recovery State”, select “Restore with No-Recovery”.
• click on OK to restore database
Restoring Database Transactional Log
• Click on “+” to expend Databases
(make sure that the database you recently restoring from backup file is in “restoring state” now)

• Right-click on “EmployeDB” (or whatever you named it), then click on “Task” from the
menu, then click on “Restore” and then click on “Transactional Log”
• Restore Database window will appear
• in the “source” section,
• select “From Device” option, then
• click on device then click on “….” icon/button to locate your backup files.
• Click on “Options” from the left menu,
• in “restore State” section, select second option “…… Restore with No-Recovery”.
• click on OK to restore database transactional log.
If you follow the steps properly, then the target database i.e. EmplyeeDB is in restoring mode.

Creating Database Mirror


• Go to main SQL instnace
• click on “+” to expend Databases
• Right-click on your database i.e. EmployeeDB (or whatever you named it).
• Click on Task from menu, then click on “Mirror”
• Mirror setup window will appear,
• click on “Configure Security”, this will launch mirroring wizard. click on “Next” on first
screen.
• in Witness Server window, select no then click next
• in Principal Server window, your main sql instance is selected by default. click next.
• in Mirror Server window, select mirror server instance or click on “Connect” to connect
your mirror server instance. click on next
• in Service Account window, do nothing (for this lab scenario only), click on “Next”.
• click on “Finish” to apply mirroring configuration.
• now the configuration will prompt you for start mirroring, probably 2 dialog boxes will
appear, click ok, or yes appropriately.
If everything works fine then mirroring will start. Otherwise error will appear.

To Fix Error
• Click on window icon/start menu
• Write “configuration” in search, it will show “SQL Server Configuration Manager”, click on
it to launch it.
• A dialog box will appear, click on “Yes” to proceed.
• In SQL Server Configuration Manger, from the left menu, click on “SQL Server Services”.
• in the right panel, you will have two SQL Servers listed (Main instance and mirror instance)
• Right-click on SQL Server instance and click on properties.
• In Properties window, under “Log On” tab, click on “This account” and enter your
computer username as “.\UserName” and password in respective fields. Then click on OK.
• Repeat the step 6 and 7 for SQL mirroring server instance.
• When you have done. Right click on respective SQL Agent service and click on “start” to
start that service.
Once you have done, re attempt for mirroring exercise this time it will not prompt.

You might also like