Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does SQL Server say "Starting Up Database" in the event log, twice per second?

Tags:

I have a SQL Server [2012 Express with Advanced Services] database, with not much in it. I'm developing an application using EF Code First, and since my model is still in a state of flux, the database is getting dropped and re-created several times per day.

This morning, my application failed to connect to the database the first time I ran it. On investigation, it seems that the database is in "Recovery Pending" mode.

Looking in the event log, I can see that SQL Server has logged:

Starting up database (my database)

...roughly twice per second all night long. (The event log filled up, so I can't see beyond yesterday evening).

Those "information" log entries stop at about 6am this morning, and are immediately followed by an "error" log entry saying:

There is insufficient memory in resource pool 'internal' to run this query

What the heck happened to my database?

Note: it's just possible that I left my web application running in "debug" mode overnight - although without anyone "driving" it I can't imagine that there would be much database traffic, if any.

It's also worth mentioning that I have a full-text catalog in the database (though as I say, there's hardly any actual content in the DB at present).

I have to say, this is worrying - I would not be happy if this were to happen to my production database!

like image 437
Gary McGill Avatar asked Aug 22 '12 10:08

Gary McGill


People also ask

Why does SQL Server have multiple instances?

A second area in which multiple instances provide great benefit is server consolidation. Instead of having 10 machines to run 10 applications, a company can run all applications on one machine. With separate SQL Server instances, each application can still have its own administrator and its own users and permissions.

What is PITR in SQL Server?

In this article Use point-in-time restore (PITR) to create a database as a copy of another database from some time in the past. This article describes how to do a point-in-time restore of a database in Azure SQL Managed Instance.

Can a SQL Server have multiple instances?

You can install multiple instances of SQL Server, or install SQL Server on a computer where earlier SQL Server versions are already installed. The following SQL Server-related items are compatible with the installation of multiple instances on the same computer: Database Engine. Analysis Services.


1 Answers

With AUTO_CLOSE ON the database will be closed as soon as there are no connections to it, and re-open (run recovery, albeit a fast paced one) every time a connection is established to it. So you were seeing the message because every 2 second your application would connect to the database. You probably always had this behavior and never noticed before. Now that your database crashed, you investigated the log and discovered this problem. While is good that now you know and will likely fix it, this does not address you real problem, namely the availability of the database.

So now you have a database that won't come out of recovery, what do you do? You restore from you last backup and apply your disaster recovery plan. Really, that's all there is to it. And there is no alternative.

If you want to understand why the crash happened (it can be any of about 1 myriad reasons...) then you need to contact CSS (Product Support). They have the means to guide you through investigation.

like image 187
Remus Rusanu Avatar answered Jan 04 '23 00:01

Remus Rusanu