Monday, March 26, 2012

Offline command hangs when I try to take database offline

Hi, I am relative newbie to SQLServer. When I try to take a user database offline, the query "hangs," with the query processing circle spinning. The Sharepoint 7 application is running on top of the Enterprise SQL Server 2005 db with several logins sleeping and awaiting commands. No errors are generated until I kill the offline command. Anyone have any ideas? Do I need to kill all the connections?Are there any users / connections to the database that you want to take offline? If so, you should ensure that these are disconnected first, as you cannot take a database offline until there are no outstanding connections.

Thanks,|||

Try "alter database <db> set restricted_user with rollback immediate" before setting it offline. This will terminiate user connections and rollback their transactions and only allow priviledged users to connect.

No comments:

Post a Comment