Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 High Availability (2005)
 SQL Mirroring and Domains/WOrkgroups

Author  Topic 

gazat2e2
Starting Member

5 Posts

Posted - 2008-10-01 : 08:23:12
Hi,

I have set up a SQL mirror with a witness for a client on SQL 2005. The SQL machines reside on a domain and work correctly. The web applications that call SQL, however, reside on a DMZ in a workgroup. I have a test application which works perfectly when ran on a domain machine, however, if I run the application on a web server, I get strange results. The application works until I fail over the database (which fails over correctly) - at which point I get a client login error and the application breaks. If I rebuild the application, it works again, using the mirror. If I now fail it back over to the original prinicple, the application continues to work correctly. Failing over again causes the application to break again. The behaviour seems consistant in which way it works or doesnot.

Very strange - any help would be greatly appreciated.

Thanks

Gareth

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-10-01 : 11:17:42
You should setup Failover Partner in your connection strings .Look at Microsoft whitepaper on Application Failover in DB mirroring.
Go to Top of Page

gazat2e2
Starting Member

5 Posts

Posted - 2008-10-01 : 15:05:37
Hi Sodeep,

I have added the failover partner in the connection string, just as I would do normally. As I mentioned, the strange thing is, the application works perfectly when the calling web server is on the domain, just not when on a workgroup.
Go to Top of Page

Mike2008
Starting Member

11 Posts

Posted - 2008-10-15 : 14:16:55
The problem with mirroring is that the system databases, which contains the user and password for example, are not (and cannot) be mirrored. Therefore the database won't be associated with a user once it fails over.

You will have to use certificates in order to make it work in a workgroup environment ..

http://alan328.com/SQL2005_Database_Mirroring_Tutorial.aspx
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-10-15 : 14:19:12
The user/password issue in the master database, mentioned by Mike2008, is not really an issue for database mirroring. You can easily keep the logins in synch between two instances using a method like this: http://weblogs.sqlteam.com/tarad/archive/2008/06/24/How-to-transfer-SQL-logins-between-SQL-Server-2005-instances.aspx

We use database mirroring for about 50 databases. We failover to our disaster recovery site twice a year to practice DR. It's so easy to synch the users.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

gazat2e2
Starting Member

5 Posts

Posted - 2008-10-15 : 14:46:53
I appreciate your responses and you may be on to something. I do currently, however, copy the usernames, passwords and SIDs on to the Primary and Mirror server. I don't believe I have copied them on to the Witness - I wonder if this could be the issue.
Another area I am exploring is if the fact that the web servers in the DMZ do not run NetBios.

Thanks

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-10-15 : 14:57:10
Can you track down the SQL Server exception associated with the application error by running SQL Profiler? Seeing the exception error message help us track it down for you.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-10-15 : 14:58:12
Also, the users don't need to be on the witness.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

gazat2e2
Starting Member

5 Posts

Posted - 2008-10-15 : 15:19:27
Thanks - great to know I hadn't made a mistake by not putting them on the witness.
I do not have access to the clients' machines at the moment, but I do know that the test web application I created reported that it could not connect to the database, once it was failed over - almost like it didnot know there was a witness.

'An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) '

I will try to get them to give me a more accurate report back. As I mentioned, the wierd thing is, exactly the same code worked perfectly when ran on a web server that was on the domain.
Thanks again
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-10-15 : 15:56:16
Aha, that's not an application error. That's the SQL Server exception.

It's a connectivity issue and not an issue with database mirroring.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

gazat2e2
Starting Member

5 Posts

Posted - 2008-10-15 : 16:00:47
Cool - so I could be on the right lines with this being a Netbios issue.
Thanks
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-10-15 : 17:28:34
Yes that's a possibility. I've got a blog on that error: http://weblogs.sqlteam.com/tarad/archive/2008/05/23/60609.aspx

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -