Link to home
Start Free TrialLog in
Avatar of dougclingman
dougclingman

asked on

After deleting a database - receiving 3760 Errors in eventviewer

Application logs error (start)
---
SQL Database 'XXXX' on SQL Server instance 'np:\\.\pipe\MSSQL$Microsoft##SSEE\sql\query' not found. Additional error information from SQL Server is included below.

Cannot open database "XXXX" requested by the login. The login failed.
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
---
(end log data)
----

After taking over an SBS 2008 server I have the above 3760 error occuring about every 5 minutes in the application logs.

XXXX = database name

History, or the closest thing to it, of what I can figure out has occurred.

1) Company XXXX (same name as database) is a vendor for my client
2) No one at my client or the vendor remembers ever creating a database or installing anything on the SBS 2008 server.
3) Client does remember just deleting the database becuase it's logging files had grown so big and no one knowing what it was for.
4) About every five minutes I get the error.  

Everything that I've found so far points me to going into the properties for NT AUTHORITY\NETWORK SERVICE and making sure it is a DBO for the database... well the database is gone.

I have looked through IIS admin for any possible application/website that may be referencing this database.  either I'm looking in the wrong place or it doesn't exits.

Ditto for looking in Sharepoint administrator.

I am looking for suggestions on how to clean this error out and resolve the problem.

thanks,
Doug
Avatar of Evan Cutler
Evan Cutler
Flag of United States of America image

It sounds like you have a detach error.
I always detach a db before I Delete it completely.

Try this in CMD Prompt (administrator):
sqlcmd -S np:\\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query
use master
alter database XXXX set single_user with rollback immediate
go
sp_detach_db XXXX
go
Avatar of dougclingman
dougclingman

ASKER

arcee123,

when the response after I enter the first "go" command id the following:

Changed database context to 'master'.
Msg 5011, Level 14, State 5, Server Servername\MICROSOFT##SSEE, Line 2
User does not have permission to alter database 'XXXX', or the database doe
s not exist.
Msg 5069, Level 16, State 1, Server Servername\MICROSOFT##SSEE, Line 2
ALTER DATABASE statement failed.

where XXXX = the name of the database in the error
where servername = the actual production server name
sorry about that... poor english skills today I guess.

"when the response after I enter the first "go" command is the following:" should have been -

The response I get after I enter the first "go" command is the following:

thanks.
Increasing the points.  
ASKER CERTIFIED SOLUTION
Avatar of TempDBA
TempDBA
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Normaly before that error there should be another error-line whit error severity and state, especially last is interesting. Expect yours to be 27 or 38.
http://www.eraofdata.com/blog/sql-18456-login-failures/

Possible to profiler trace to see more details about the origin of this attempt http://msdn.microsoft.com/en-us/library/ms187862.aspx.

There will stil b a shedulled job or a service be running from that vendor that is trying every 5 minutes to do his thing with that database.
When deleting a database because it's becoming to big means something is filing it! And dropping something you don't know very well should involve a period of searching for errors that something is missing.  As earlier mentioned better first block access (read only, detach ....) after already tracing on usage to find what things should be stopped of trying again.
Avatar of Ryan McCauley
Have you checked the default database for the "NETWORK SERVICE" user in SQL Server? If their default database is set to a database that's no longer on the server, it will cause the login to fail when a different database isn't specified as part of the connection string, which could get you this error.

Check the properties on that account in SQL Server and if it's set to the missing database (or is blank), then change it to something else.
TempDBA: It was listed in Sharepoint.  I removed it from sharepoint and will monitor for additional errors (will be onsite in the morning).

jogos: thank you for the advice about carefully removing a database.  That will be good for the others who read this.  Just wish the person who removed it before I took the server over would have followed common logic.

RM: did not find that.
Thanks for pointing out the exact location in Sharepoint to look for that.  I had looked in Sharepoint ... but obviously not the right spot.

Thanks for the help.  As of this morning there are no errors for this database.