How to create a Mirroring Endpoint on Principal, Mirror and Witness SQL Server

Create a Mirroring Endpoint on Principle and Mirror Instance with ROLE=PARTNER:

On Principal Server run:

CREATE ENDPOINT Endpoint_Mirroring
STATE=STARTED
AS TCP (LISTENER_PORT=5022)
FOR DATABASE_MIRRORING (ROLE=PARTNER)
GO

On Mirror Server run:

CREATE ENDPOINT Endpoint_Mirroring
STATE=STARTED
AS TCP (LISTENER_PORT=5023)
FOR DATABASE_MIRRORING (ROLE=PARTNER)
GO

Create a Mirroring Endpoint on Witness Instance with ROLE=WITNESS:

On Witness Server run:

CREATE ENDPOINT Endpoint_Mirroring
STATE=STARTED
AS TCP (LISTENER_PORT=5024)
FOR DATABASE_MIRRORING (ROLE=WITNESS)
GO

After creating the endpoints, check their state by querying the sys.database_mirroring_endpoints system catalog view on each server:

SELECT name, state_desc, role_desc
FROM sys.database_mirroring_endpoints

mirroring endpoint state in sql server

If the post helped you, please share it:
Pin It

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">