0% found this document useful (0 votes)
70 views25 pages

Setup Database Mirroring

1. The document provides instructions for setting up database mirroring between two SQL servers located at 103.97.125.19. 2. It involves preparing the servers by configuring firewall and SQL service user settings, taking a full backup and log backup of the principal database, restoring these on the mirror server, and configuring database mirroring between the servers. 3. Key steps include configuring security without a witness, selecting listener ports, starting the mirroring, and addressing any errors by running ALTER DATABASE commands to set the partner on each server if mirroring fails to start.
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)
70 views25 pages

Setup Database Mirroring

1. The document provides instructions for setting up database mirroring between two SQL servers located at 103.97.125.19. 2. It involves preparing the servers by configuring firewall and SQL service user settings, taking a full backup and log backup of the principal database, restoring these on the mirror server, and configuring database mirroring between the servers. 3. Key steps include configuring security without a witness, selecting listener ports, starting the mirroring, and addressing any errors by running ALTER DATABASE commands to set the partner on each server if mirroring fails to start.
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/ 25

Setup Database Mirroring

Servers:
103.97.125.19 Principal
103.97.125.19 Mirror

I. Prepare (Config on Servers Principal & Mirror)


1. Turn off firewall
2. Open port 1433,5022
Go to Windows defender firewall with advanced security on local computer ->
New Inbound rules
3. Create user windows
Because servers non-domain so must create the same username & password on
principal & mirror server
Username: sqlservice
Password: abcsxr@123
And then add user to group administrator
4. Change user logon SQL service
Open SQL Server Configuration Manager -> SQL Server Services-> Right click
on SQL Server -> Browser
And then click OK

II. Config Database Mirroring


1. Create a Full backup of the Database to Mirror in the principal server.
2. Backup the Transactional Log.
3. Copy files backup
(full, Log) and
restore the
database in the
Mirror Server
Make sure to restore with the NORECOVERY State in the Mirror Server.
Retore transaction log: Righ click on database -> Tasks -> Retore -> Transaction
Log
Restore transaction log with norecovery
4. Right click on the database on principal server and select Tasks>Mirror
5. Press the Configure Security button
6. The Configure Database Mirroring Security Wizard will be displayed.
And then press next.
7. The first wizard will ask if you want a Witness. If you want the manual failover or
a high-performance mirroring, the Witness is not necessary. If you want a high
availability mirroring with automatic failover, select the yes option.

In this config, we will not use a witness and then press next
8. In the next option, you will select the ports used. We also have an option to
Encrypt the data send from one Server to Another. The Principal Server and the
Mirroring Server will be synchronizing data constantly. The Endpoint name will
be created here.

9. Connect Mirror Server Instance


Press connect and specify the connection properties ( using user sql server
authentication to connect to mirror server instance)
Also, select the listener port and the Endpoint name.
10. Config service account
If the accounts are non-domain accounts or the accounts are in trusted domains
leave the textboxes empty.
Press next
Press finish
If everything
is OK, a Success
message will be
display. Otherwise,
you will receive
error messages
Press close
You will receive a message to start the Mirroring.

If you are ready, press the Start Mirroring button -> Done

If after you press Start Mirroring and received a error below


Soulution:
Run T-SQL set partner for database on mirror server
ALTER DATABASE [AQ_CMS]
SET PARTNER = 'TCP://WIN-P94HS802CCU:5022'
GO

Run T-SQL set partner for database on principal server


ALTER DATABASE [AQ_CMS]
SET PARTNER = 'TCP://WIN-4MGGH5TLQ90:5022'
GO

And you will find that the Mirror Database is active now

You might also like