Set Mirror with Alter Database Query

Principal:
ALTER DATABASE (database name)

set partner = 'Tcp://(principal server).(computer name):(port)

Example:

 ALTER DATABASE SIMSData

set partner = 'Tcp://ACSQL.AlarmCentral.local:5022'



Mirror:
ALTER DATABASE (database name)

set partner = 'Tcp://(principal server).(computer name):(port)

Example:

 ALTER DATABASE SIMSData

set partner = 'Tcp://ACSQL2.AlarmCentral.local:5022'



Witness:
ALTER DATABASE (database name)

set witness = 'Tcp://(principal server).(computer name):(port)

Example:

 ALTER DATABASE SIMSData

set witness = 'Tcp://ACSQL3.AlarmCentral.local:5022'



The easiest way to find the port is to begin the mirroring process from the principal server.

You will right click on the database in question, click on TASK, then MIRROR.

There in the Server Network Addresses you will find the port in the principal server that will serve for all 3 servers.
Was this article helpful?
Thank you for your feedback!
User Icon

Thank you! Your comment has been submitted for approval.