Wednesday, March 21, 2012

Deployment - Database Configurations

Greetings,

I've been looking around all morning and can't seem to find a good answer on this so I thought I'd post a message here.

I'm using the recommended practice of keeping the ASPNETDB.MDF data separate from my site data. (I have my site data located in separate databases but still keep them in the App_Data directory.)

I'm using SQL Server 2005 Express on a Server 2003 box and I've implemented scheduled backups on the databases in the Sql Server.

The questions I'm having are:

1. Why isn't the ASPNETDB.MDF database getting attached to the server? Is it using User Instances?

2. If it is using User Instance then isn't this degrading performance? If so, how to force it to not use User Instance?

3. If User Instance is how it is supposed to work then how are we supposed to do a full backup of the ASPNETDB.MDF database if it isn't attached in the server? (xcopy doesn't seem to work on User Instances because of the dreaded "is being used by another process" error.)


Any recommendations, advice, links, or answers to my questions would be greatly appreciated.

1. Yes.

2. Yes, but insignificantly.

3. I believe backup software that is designed to do backups of live SQL Databases (using SQL Agents), can backup User Instances. However, if you are using SQL Express, you are likely running a low traffic site, and it might be easier to run a batch process that stops the IIS Application, xcopy the .MDF and restart the application. You can probably write a quick batch file to create a dummy offline.htm file into your web application directory, wait a few seconds, xcopy, then delete offline.htm.

There may be better approaches, but those are the ones I have off the top of my head, and I don't claim to have a vast knowledge of running Express databases on live servers.

No comments:

Post a Comment