Re: Database Mirror and Failover



Database mirroring works either way depending on which mode you're in. It's
the automatic failover in high safety mode that may or may not meet your
needs. Specifically, not the failover part but rather the new client
connections part post failover (as per your scenario).

Automatic failover only works if your client's data access layer (SNAC or
ADO/ODBC.NET) has cached both server names. This happens in the first
connection attempt on the server. This is usually the primary server unless
you have specific code in your app (just a few simple lines) to test for
both. Many DB Mirroring implementations are "as-is" using exising apps
without code tweaks so they connect to their "original" primary as per
normal ops but benefit from automatic reconnect in a failover.

However, if the primary server was down before the client connects for the
first time, it would not know there is a mirror server to connect to which
is what you're seeing. Whether it's a new client connection or a re-started
app/web server, it's the same effect; you don't have the mirror server name
cached so the app/web server or client doesn't know it exists.


joe.
"Christian Gröbner [MVP]" <newsgroups@xxxxxxxxxx> wrote in message
news:uunWT7wuHHA.2360@xxxxxxxxxxxxxxxxxxxxxxx
Hello,

I'm just configuring a Database Mirror with SQL 2005 SP2. I have two
SQL-Servers SQL1 and SQL2 and one Whitness. Everything is working fine, when
I plug out the ethernet cable from SQL1 the whitness is detecting the
failure an is switching over to SQL2 and so on. The running application is
connecting to SQL2 after the failure. In case of a restart of the
application the client tries to connect to SQL1, which is not reachable. As
I'm expecting there should be a connect to SQL2 after the sqlclient can't
reach SQL1 but with netstat -na I only see connection attempts to SQL1. From
a former posting I got the Information about some existing connections to
SQL1, but I made a restart of the client so be sure that there is no
existing connection to SQL1. When both SQL-Servers are reachable and I do a
manual failover everything is working fine, so I think database mirroring
only works, when both servers are online. Is this true?

My connection string looks like this:

Data Source=DBSRV1;Failover Partner=DBSRV2;Initial Catalog=TEST;User
ID=test;Password=test;Network Library=DBMSSOCN;Load Balance Timeout=5"

Thanks for your help

Greetings from Germany

Christian

--
Christian Gröbner
MVP ISA Server
Hilfe & Infos rund um den ISA Server: http://www.msisafaq.de !!!!

NEU !!! Das Handbuch zum ISA 2006 - http://www.msisafaq.de/buch/


.



Relevant Pages

  • Re: Merge Replication & Database Mirroring
    ... I normally hardcode the failover server name in some retry logic. ... So if it fails on connection, it sleeps for 5 seconds and then retries 5 times. ... I have set up a principal server that also acts as publisher for a merge replication. ... If I do a manual failover, then the Mirror server becomes the Principal and also acts as the Publisher. ...
    (microsoft.public.sqlserver.replication)
  • Re: IPSEC and Failover
    ... This is a problem to IPsec standard. ... The latency relates to re-establishing IPsec connection - it's both client ... > server enviorment. ... Does the latency to create new sessions in case of failover relates to ...
    (microsoft.public.security)
  • Re: Veritas storage foundation HA for windows
    ... How about Veritas Storage Foundation "HA" for Windows? ... "If one of the servers or resources running on the server in a cluster ... a process known as failover." ...
    (microsoft.public.sqlserver.clustering)
  • Re: Failover
    ... real-time failover. ... out the backup cloned drive and put it in the main machine. ... It's a great alternative to Microsoft's Cluster Service because it's less expensive and much easier to install for smaller businesses that can't afford or maintain a server cluster. ... Double-Take claims it's as easy as installing antivirus on your server. ...
    (microsoft.public.windowsxp.general)
  • Re: Failover
    ... real-time failover. ... smaller businesses that can't afford or maintain a server cluster. ... it's as easy as installing antivirus on your server. ... "Can't unix run windows and I can take ...
    (microsoft.public.windowsxp.general)