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

Posted on 2011-03-14
Last Modified: 2012-05-11
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.  
Question by:swtjen1
  • 3
  • 3

Expert Comment

ID: 35132352
Well, when you create a content database,  you specify which web application it will be created 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.

Expert Comment

ID: 35132687
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.
LVL 38

Expert Comment

by:Justin Smith
ID: 35136740
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.
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.


Author Comment

ID: 35138263
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.
LVL 38

Expert Comment

by:Justin Smith
ID: 35138281
So, is SharePoint and SQL on different servers?  Or all on one?  if different, where are you seeing the errors (what log)?

Accepted Solution

ThatSharepointGuy earned 500 total points
ID: 35138722
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, 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.
LVL 38

Expert Comment

by:Justin Smith
ID: 35242857
update please.

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SharePoint 2010 Foundation Gatherer 10 66
Count with a subquery showing details 10 42
Help Required 3 93
SQL Error - Query 6 24
We had a requirement to extract data from a SharePoint 2010 Customer List into a CSV file and then place the CSV file into a directory on the network so that the file could be consumed by an AS400 system. I will share in Part 1 how to Extract the Da…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit If you want to manage em…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question