Why is a content db showing failed service logins in Sql Server 2008r2?

We had an old content db that was not mounted and tried to take it offline.  When we did it returned service account login errors.  I am wondering why these errors are happening because this content db is not attached to a site collection.

The only other thing is that our current web app uses the same service account name but I don't see how that would have any bearing on a completely different content db with a different name.  We want to take the db offline and see then see if we need to keep it however it is throwing these errors.  
Who is Participating?
ThatSharepointGuyConnect With a Mentor Commented:
Well, you'll know it's attached to a web application by just looking at your list of databases.
Central Administration > Application Management > Manage Databases > select your Web App from the drop down > view content databases associated with that.

Have you tried removing it completely (after backing up your transaction logs, ldf, and mdf files)?  I was under the impression that you wanted to find out if you needed that database or not, so if you're trying to test that out, I believe removal to be the best way (since you'll also have a backup).

You could also run this script, located here http://sharepointpsscripts.codeplex.com/releases/view/53114, to enumerate through all of your content databases (through all web applications, as well), to see if it might give you an idea if it's being ran somewhere in your 2010 farm.  You'll need Powershell on the 2007 machines in order to run this on those, though.
Well, when you create a content database,  you specify which web application it will be created under...so if all of your content databases are under the same web application, it will use the access account that the web application uses.

Have you tried moving the content database to a new, empty web application?
You could go and create a new web application, and then attach the database there.  

Moving it this way might solve the issue, or at least bring other issues to light.  If possible, make the service account that runs on the 2nd web application different than your 1st web application, so that you can differentiate the errors that (may/most probably will) show up.
You know what, I misread the fact that it wasn't mounted!  Sorry about that!  The access account for that database will still be the same, I believe, as the account that created it.  Even though it is not mounted, the permissions within SQL Server Management Studio on that database are going to be the same.

A quick thing to check would to open up the SQL Server Management Studio, log in, expand databases, expand the database that you're looking for, and check out the security, logins, and roles on it.  You can change the accounts there (removing or adding, etc).  If it's not mounted, you should be fine.

And since it's not mounted into SharePoint, you can back the LDF and MDF and logs to a file share somewhere, and then remove the database completely from your SQL server...which should get rid of pretty much all of your errors.  You still have the LDF/MDF/Logs, so you can re-attach the database to the SQL server if needed, and from there attach it to a site collection if needed.

But if you're looking to just completely remove this database from the picture to see if your farm is ok without it, then do what I suggested with backing up the database, and then removing it from the database.  You can always restore later, and since nobody is using it, it shouldn't cause any problems.
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Justin SmithSr. System EngineerCommented:
Not sure what version of SharePoint you are on, but I've seen this issue in multiple 2010 farms.  Random SQL login failures to databases that are attached to apps.  I'm starting to think it's a bug in 2010.
swtjen1Author Commented:
Yeah this database is not mounted to any site collection and it is a 2007 db that we moved over to a 2008 sql r2.  It was a temporary content db we used to move over information into our 2010 environment.

We ran a trace and it appears to be coming from a test server (Sharepoint 2007) we don't even use any more.  I went to look at the web application list and site collections and that content db is not listed anywhere.  So that confuses me more.  

Maybe it could be attached to an app somewhere?  I will look and see if that could be the case but I'm not sure how.  Thank you for your suggestions.
Justin SmithSr. System EngineerCommented:
So, is SharePoint and SQL on different servers?  Or all on one?  if different, where are you seeing the errors (what log)?
Justin SmithSr. System EngineerCommented:
update please.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.