Tutorial Mirroring
Tutorial Mirroring
Home
Database mirroring connection error 4 'An error occurred while receiving data: '10054(An existing
connection was forcibly closed by the remote host.)'.' for 'TCP://mymirror.mydomain:5022'
or
or
Database Mirroring login attempt by user 'NT AUTHORITY\ANONYMOUS LOGON.' failed with error:
'Connection handshake failed. The login 'NT AUTHORITY\ANONYMOUS LOGON' does not have
CONNECT permission on the endpoint. State 84.
Well, if you are having the above error messages, I hope this tutorial could help you.
-- HOST A
create master key encryption by password = 'abc123!!';
GO
create certificate HOST_A_cert with subject = 'HOST_A certificate', start_date = '2007/11/01', expiry_date =
'2020/11/01';
http://alan328.com/SQL2005_Database_Mirroring_Tutorial.aspx 25/02/2008
SQL 2005 Database Mirroring Tutorial Page 2 of 3
GO
-- HOST B
create master key encryption by password = 'abc123!!';
GO
create certificate HOST_B_cert with subject = 'HOST_B certificate', start_date = '2007/11/01', expiry_date =
'2020/11/01';
GO
-- HOST W
create master key encryption by password = 'abc123!!';
GO
create certificate HOST_W_cert with subject = 'HOST_W certificate', start_date = '2007/11/01', expiry_date
= '2020/11/01';
GO
-- HOST A again
create login HOST_B_login with PASSWORD = 'abc123!!';
GO
-- HOST B again
create login HOST_A_login with PASSWORD = 'abc123!!';
GO
http://alan328.com/SQL2005_Database_Mirroring_Tutorial.aspx 25/02/2008
SQL 2005 Database Mirroring Tutorial Page 3 of 3
-------
create login HOST_W_login with PASSWORD = 'abc123!!';
GO
-- HOST W again
create login HOST_A_login with PASSWORD = 'abc123!!';
GO
-------
create login HOST_B_login with PASSWORD = 'abc123!!';
GO
-- HOST B again
alter database good set partner = 'TCP://server1.ace.local:7024';
GO
-- HOST A again
alter database good set partner = 'TCP://server2.ace.local:7024';
GO
Alan - [email protected]
http://alan328.com/SQL2005_Database_Mirroring_Tutorial.aspx 25/02/2008