[ACCEPTED]-Why does SQL Server say "Starting Up Database" in the event log, twice per second?-sql-server-2012

Accepted answer
Score: 26

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

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

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

Score: 21

If you wanted to turn off this message in 2 event log. Just goto SQL Server Management 1 Studio,

  1. Right click on your database
  2. Select Options (from left panel)
  3. Look into "Automatic" section, and change "Auto Close" to "False"
  4. Click okay

That's All :)

Score: 2

I had a similar problem with a sql express 9 database stuck in recovery. After investigating 8 the log it transpired that the database 7 was starting up every couple of minutes. Running 6 the script

select name, state_desc, is_auto_close_on from sys.databases where name = 'mydb'

revealed that auto close was set 5 to on.

So it appears that the database is 4 in always in recovery but is actually coming 3 online for a brief second before going offline 2 again because there are no client connections.

I 1 solved this with following script.

Declare @state varchar(20)
while 1=1
     Select @state = state_desc from sys.databases where name='mydb';
     If @state = 'ONLINE'
           Alter database MyDb
                 Set AUTO_CLOSE_OFF;
           Print 'Online'
        waitfor delay '00:00:02'

More Related questions