Sunday, March 25, 2012
Database Mirroring Connection Question
fail-over
occurs, all client connections are lost. A retry from client/s,
applications, etc... will
reconnect to the Failover.
In order to compensate for the disconnect you should make use of TRY CATCH
logic within your code.
When going over that statement, TRY CATCH is not valid for disconnects so
how would you accomplish this feat?
What I mean is how could I allow my application to essentially reestablish
the coonection or look for the Failover from within my Connection String?
--
Anthony E. Castro - MCDBADoesn't the disconnect raise a SqlException that could be caught and you
resubmit the failed request? Have you tried this already?
In case you are using ADO.Net 2.0 or later, you have a 'failover
partner' parameter in the connection string that SqlClient will use to
connect to if there was loss of connectivity to the primary server.
So, all your application needs to do is resubmit the request - whichever
database - principal or the new principal - that SqlClient is able to
connect to will be used.
acmcdba68 wrote:
> I've read several instances that when implementing Database Mirroring and a
> fail-over
> occurs, all client connections are lost. A retry from client/s,
> applications, etc... will
> reconnect to the Failover.
> In order to compensate for the disconnect you should make use of TRY CATCH
> logic within your code.
> When going over that statement, TRY CATCH is not valid for disconnects so
> how would you accomplish this feat?
> What I mean is how could I allow my application to essentially reestablish
> the coonection or look for the Failover from within my Connection String?
>
Database mirroring connection errors
I'm currently using database mirroring as a hot-standby, without a witness. Everything appears to be running fine, but I'm receiving intermittent errors that appear to state that my servers are loosing connectivity, thus disabling (inactivating) the mirror until the connection has been reestablished.
The errors are listed below, basically, I note a block of log entries for each mirrored database stating that mirroring is inactive for the database(s), next Error 1474, next the connection error, then another block of log entries for each mirrored database stating that the mirroring session is once again active.
Database mirroring is inactive for database 'NetRS'. This is an informational message only. No user action is required.
Error: 1474, Severity: 16, State: 1.
Database mirroring connection error 4 '64(The specified network name is no longer available.)' for 'TCP://SQL01NRS:7024'.
Database mirroring is active with database 'Telephony' as the principal copy. This is an informational message only. No user action is required.
I have confirmed that the sessions are in sync, so am not concerned about the data - but would love to get rid of these errors / disable / enable. I'm assumming that if I had setup a Witness, that I would see the mirrored database flip-flopping back and forth between Principal and Mirror.
Please let me know if I can provide any additional details to assist ...
Hi,
What build (service pack) of SQL Server you are runnng.
Check the following link if any of this applies to your situation.
http://support.microsoft.com/kb/912422
Jag
|||Edition and Build Information on server acting as Principal
Enterprise Edition 9.00.2047.00
Edition and Build Information on server acting as Mirror
Enterprise Edition 9.00.2047.00
|||Jag:
Thanks for your inquiry and feedback. I looked over the article that you referenced, and appears that this might be applicable. We are running a Synchronous mirroring session without a Witness. Unfortunately, we are running SP1, and this issue appears to have been resolved with SP1. Any ideas?
|||Hi,
If there are no other errors in SQL server error log, then its possible that the problem is likely to be the windows server or the network.
Error 64 is a windows error.
Check the following:
http://support.microsoft.com/kb/888319/en-us
regards
Jag