views:

68

answers:

1

I have successfully configured a principal and mirror with SQL Server 2008 and Windows Server 2008 R2 64bit. However, when I attempt to add a witness (SQL Server 2005 and Windows Server 2003 32bit) to the mix, I get the following errors in the event log of the primary: EventID 1456 "The ALTER DATABASE command could not be sent to the remote server instance 'TCP://SERVERNAME.DOMAIN:5022'. The database mirroring configuration was not changed. Verify that the server is connected, and try again." and EventID 1474 "Database mirroring connection error 4 'An error occurred while receiving data: '64(The specified network name is no longer available.)'.' for 'TCP://SERVERNAME.DOMAIN:5022'."

I can see a temporary established connection on port 5022 via netstat and SQL Profiler and then these errors.

Does anyone know why this is happening?

+1  A: 

Does your partner name match exactly the FQDN of the mirror? The behavior you describe can happen when the mirror (or principal for the matter) knows himself (the return of GetComputerNameEx)by a different name than the name used partner in the ALTER DATABASE ... SET PARTNER = 'tcp://partnername:...';. Consider this scenario:

  • the principal uses the name Foo for the mirror. Foo is resolved through the hosts file to the correct IP of the mirror
  • the mirror knows himself as Bar.
  • when a witness is added the principal will as 'what is the status of Foo, do you see him?'. The mirror will report to witness 'hello, I'm Bar'. So the witness will report back to the principal 'I don't know where Foo is' and this can end up breaking the mirroring session.

There are more details and nuances. The gist of the story is: always use FQDN names properly resolved through DNS when setting up mirroring.

Remus Rusanu
Yes, the partner name matches the FQDN. I have checked the name with ipconfig, DNS, and nslookup. Through SQL Profiler and the Windows Event Viewer, I can see the principal connect to the witness but it appears there is no response from the witness and I get the error messages listed above. The principal and mirror connect with no issues.Is there anything else I am missing?
Is the security between witness and principal correct? The witness needs CONNECT permissions on the principal's mirroring endpoint.
Remus Rusanu
The windows account for the database engine on the principal, mirror, and witness has been granted CONNECT permissions to the endpoint(s).
If I point the mirror to a server with SQL 2008 it works. Can you use SQL Server 2005 as a witness for a SQL 2008 mirror? Was this a wrong assumption to make?
Afaik combinations in any role (principal/mirror/witness) of different versions (2005, 2008, 2008R2) are not supported, no matter the combinations. You would have to clear this with CSS or risk running an unsuported configuration (if it breask, you're on your own).
Remus Rusanu