Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I'm not having issues with the actual mirroring part, but because of the use of temporary tables, IIS is throwing a bit of a wobbler if a failover occurs (I'm still testing a few things, so it's me causing the failover).

Is it possible (or even a good idea) to mirror tempdb? Or should I just accept that some people might get kicked out if the principal database is not accessible for any reason.

I'm using ASPState so that the two web servers (behind a load balancer that enables sticky sessions) can both get to the same session data.

share|improve this question

2 Answers 2

up vote 7 down vote accepted

Mirroring tempdb, that's a no. Have you checked Step-by-step SQL Mirroring the ASPState database?

If the -sstype:p parameter is not specified, then by default, the ASP.NET sessions will be put into the TempDB database and not the ASPState database. This confused me for a while. This is fine for a normal non-mirrored environment because the ASP sessions will be cleared if the server is restarted. But, this is not fine for the mirrored environment, because we want to mirror the ASP session data itself, not just the Stored Procedures! Also, mirroring is not possible on the TempDB database. The -sstype:p parameter makes ASP.NET install the session tables into the ASPState database, and they'll be persisted if the server is restarted. This is exactly the behaviour we want for a mirrored environment.

share|improve this answer
3  
And this doc tells you all the possible options you can change using aspnet_regsql.exe (including changing the sstype). msdn.microsoft.com/en-us/library/ms229862%28v=vs.80%29.aspx Just wanted to note that you should be able to set this option after install, not just as a part of install as might be inferred from the CodeProject article. –  Aaron Bertrand Sep 6 '11 at 13:53
    
Mark, I really need to buy you a drink. Thank you. I was actually following those instructions to start with the other day, but somehow managed to miss that bit. I was using the InstallSqlState.sql script to install the ASPState db –  Piers Karsenbarg Sep 7 '11 at 14:32
    
Pleasure, honestly. I did a fair bit of head scratching the first time I tackled mirroring. –  Mark Storey-Smith Sep 7 '11 at 22:49

From MSDN - Database Mirroring Overview: "You cannot mirror the master, msdb, tempdb, or model databases."

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.