MSSQL 2005 Database Mirroring With Certificates

For the last week or so I have struggled to get database mirroring with failover (failover being a witness machine) working as advertised from Microsoft. After struggling with error messages like this for the past few days:

I finally broke down and called Microsoft and opened up a new case. After 10 hours (yes 10) and 4 levels of Microsoft tech support, there was still no resolution (or even a clue) from Microsoft and we gave up for the day. We both decided that we would recreate this environment in respective testing scenarios. Since our environment was hosting production databases the changes we could make were limited and setting up a testing environment seemed like the logical thing to do.

After a few more hours of rebuilding and service packing I had a mirror of our production instance up and receiving the same errors. On a hunch and a post by this guy we decided to setup DNS entries for all of our machines and setup mirroring using fully qualified domain names. Long story short, IP’s or any kind of aliases do not work for SQL mirroring with a witness, though it does work for just mirroring. You must use <machinename>.<dnssuffix> in order for mirroring with failover to work.

Here is the writeup and soon to be knowledge base article (will be KB940254) from Microsoft:

ACTION: Trying to add a witness to and existing database mirroring configuration that was configured with certificates in a workgroup that uses host files and dns.

RESULT:

ALTER DATABASE [database_name] SET witness = ‘TCP://www02:7024’;

Error :
———————–
Msg 1456, Level 16, State 3, Line 1
The ALTER DATABASE command could not be sent to the remote server instance ‘TCP://www02:7024’.         The database mirroring configuration was not changed. Verify that the server is connected, and try again.

CAUSE:  SQL Server database mirroring with a witness requires a FQDN inorder to resolve the machine name.

RESOLUTION:
Create DNS entries for all internal IP addresses. In the IP address configuration under the DNS tab change “Append primary and connection specific DNS suffixes” to “Append these DNS suffixes (in order):” and enter the appropriate DNS suffix. Click “OK” to the remaining dialogs.

After <machinename>.<suffix> begins to resolve from your DNS server execute the “ALTER DATABASE” commands with the appropriate FQDN of each machine.

Leave a Comment