Auto Draft

I had a strange experience just now.

I noticed that when I started my SQL Server 2012 service, the SQL Serve process would start allocating more and more memory and it would quickly reach the memory limit.

I also noticed that the disk system was quite active, even though there was nothing obvious to make it so.

I started wondering what would be the reason, and after a minute of exploration, I realized that one of my databases on the instance was (In Recovery) state.

Now I realized that yesterday I was running some tests – some large file XML imports, and the computer crashed in the middle.

This had made the data in the database inconsistent, and on startup SQL Server was trying to recover the database to its last good state.

In this case, I guess there are two options:

  • either leave SQL Server to do its best to recover the database – this might take some time and disk space
  • or, if you do not care about the database and its latest recoverable data, you can remove it and restore from backup

In my case this was just a test database, and I could recover it faster if I executed a few scripts.

So I stopped the SQL Server 2012 service, renamed the database files on disk, then I started the SQL Server service.

When I connected to the instance, I saw that the status of the database had changed from (In Recovery) to (In Recovery Pending). 

This way I was able to drop the database and create a new one.




Comments are closed.