6

Is there anyway to restart one database in SQL Server instead of restarting the entire server? I have a task in perpetual rollback on one of my databases. I'd like to restart it without turning off / on the other DBs

  • 1
    What do you mean 'restart' a database? – Arran Sep 5 '12 at 13:34
9

You can try taking it offline, and then online again:

use master
go

alter database YourDatabase
set offline
with rollback immediate
go

alter database YourDatabase
set online
go

As per BOL:

OFFLINE : The database is closed, shut down cleanly, and marked offline. The database cannot be modified while it is offline.

| improve this answer | |
  • 1
    +1 but not sure if this can fix perpetual rollbacks – Andomar Sep 5 '12 at 13:41
  • @Andomar To be honest, neither am I. I'd have to run a test to verify. But that'd be my next step. – Thomas Stringer Sep 5 '12 at 13:55
0

I tried to take the DB offline, but because of the perpetual rollback wasn't able to do so. Had to eventually restart the server

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.