Tuesday, March 29, 2011

Offline command hangs when I try to take database offline

Before you take a database offline be sure there are no users / cnnections / or even SQL managment studio connected because you cannot take a database offline until there are no outstanding connections.

You can use the next command before setting it offline:
alter database DB_NAME  set restricted_user with rollback immediate

This will terminiate user connections and rollback their transactions and only allow priviledged users to connect.

No comments:

Post a Comment