SQL Server database constantly restarting

9,690

Your database is set to AUTO_CLOSE ON. Every time no user is connected to it, it closes. Every time a new connection uses the database, it starts. These is likely a database created on SQL Express and then attached to a non-Express SKU, because Express creates the databases as auto-close on by default.

Simply set it to AUTO_CLOSE OFF:

ALTER DATABASE <dbname> SET AUTO_CLOSE OFF;
Share:
9,690

Related videos on Youtube

Artur Peniche
Author by

Artur Peniche

Updated on September 17, 2022

Comments

  • Artur Peniche
    Artur Peniche almost 2 years

    We have SQL Server 2008 Express installed on a Windows 2003 server. Looking at the event log, one of the databases appears to be restarting anywhere from every couple seconds to every 15 to 30 minutes.

    This server hosts about half a dozen databases; the problem is with only one. This database is also the onle one comprised of multiple schemas (not just dbo).

    There are thousands of events going back several months. There doesn't seem to be any affect on the website using the database, nor does any data appear to be corrupted or compromised. I'm not a DBA, so I don't even know where to look for causes to this. Any suggestions?

    Edit: This is a sample entry from the event viewer:

    Date: 6/1/2010 Time: 11:20:52 AM Type: Information User: N/A Computer: MyServer Source: MSSQL$SQLEXPRESS Category: Server Event ID: 17137 Description: Starting up database 'MyDatabase'.

  • Remus Rusanu
    Remus Rusanu about 14 years
    Actually, looking at the 'MSSQL$SQLEXPRESS' in the error, this is a SQL Express SKU, so it is normal for the database to be auto_close. I would still turn it off.