question

jimbobmcgee avatar image
jimbobmcgee asked

ERRORLOG contains thousands of entries for 'Starting up database' for a database that does not exist

As suggested in the title, my ERRORLOG is being swamped with notifications that it is starting a database, but the database it mentions does not exist (either in the SSMS Object Explorer or when doing `select * from master.sys.databases`). From its name, I can see that it certainly looks like one that might have existed once, but it certainly doesn't any more. I'm getting these entries 3-4 times every 10 or so seconds. There are no subsequent obvious error entries that might indicate a job or porcess that is causing this. How might I find out why SQL Server thinks this database exists and how would I go about removing it properly?
sql-server-2008-r2error-message
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Just double-checked Connect over at Microsoft. No reports of a bug like this. Have you tried restarting the server? Stupid solution I realize, but it sometimes works. Sorry I haven't been more helpful.
1 Like 1 ·
jimbobmcgee avatar image
jimbobmcgee answered
I think it is one of my devs creating snapshots like they're going out of fashion. He has a process going around ever 10s that is creating a snapshot, doing some work and then dropping it. It will be running every hour in live, but is running every 10s in test because he absolutely *must* have a quick turnaround for his tests! As for why it is doing it 3-4 times, I can only guess that he is not reusing his .NET SqlConnection to the snapshot and that it is set to AUTO_CLOSE (as per the comment by @ramesh-1) -- can one run `ALTER DATABASE snapshot_name SET AUTO_CLOSE OFF` against a snapshot?
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

It was, indeed, an errant snapshot-creating process. No joy on `SET AUTO_CLOSE OFF`, though...
0 Likes 0 ·
Grant Fritchey avatar image
Grant Fritchey answered
That is not one I've seen before. First thing I'd do is run DBCC checks against all the system databases to ensure that they're in good shape. Check sys.database_recovery_status to see if there's an outstanding entry there. Not sure what to do if you find one, but that's where I'd look. Try issuing another DROP statement for that database (probably won't work). After that, I think I'd put extended events on the server to capture errors as they occur and errors written to the log just to see if it's possible to get more information than the log is providing. After that, I think it's time for a call to Microsoft.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ramesh 1 avatar image
ramesh 1 answered
if the database is visible, then go to the properties of the database then set auto close option to false, then run the dbcc checkdb of the datbase.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.