Ask Paula!

...bringing you notes from the field...

  • Home
  • Archives
  • Contact
  • Login

Archives

  • January 2019 (2)
  • August 2018 (1)
  • June 2018 (1)
  • May 2018 (3)
  • February 2018 (1)
  • November 2017 (1)
  • August 2017 (3)
  • July 2017 (1)
  • June 2017 (1)
  • March 2017 (1)
  • January 2017 (2)
  • March 2016 (1)
  • January 2016 (1)
  • December 2015 (3)
  • September 2015 (4)
  • May 2015 (1)
  • April 2015 (3)
  • March 2015 (1)
  • January 2015 (1)
  • July 2014 (1)
  • June 2014 (2)
  • May 2014 (2)
  • April 2014 (2)
  • December 2013 (2)
  • October 2013 (4)
  • September 2013 (5)
  • August 2013 (3)
  • July 2013 (2)
  • March 2013 (8)
  • November 2011 (3)
  • October 2011 (3)
  • September 2011 (2)
  • August 2011 (2)
  • July 2011 (2)
  • June 2011 (5)
  • May 2011 (3)
  • February 2011 (2)
  • November 2010 (1)
  • October 2010 (3)
  • September 2010 (2)
  • August 2010 (1)
  • May 2010 (2)
  • November 2009 (2)
  • August 2009 (2)
  • June 2009 (2)
  • May 2009 (4)
  • March 2009 (5)
  • January 2009 (4)
  • December 2008 (5)
  • November 2008 (3)
  • September 2008 (4)
  • August 2008 (2)
  • July 2008 (2)
  • June 2008 (1)
  • May 2008 (4)
  • April 2008 (1)
  • March 2008 (5)
  • February 2008 (2)
  • January 2008 (7)

Post Categories

  • Azure

Image Galleries

  • .NET Development

Enterprise Integration

  • BizTalk Gurus

Entertainment - Games

Java Development

Mobile/PDA Development

Professional Affiliations

  • Association of Professionals in Business Management
  • Computer Professionals for Social Responsibility
  • Data Management Association
  • Institue of Electronics and Electronic Engineers
  • Metropolitan Design and Development
  • Modern Language Association

Syndication:

  • RSS
  • ATOM

News

Copyright © 2008-2019 Paula DiTallo

Tag Cloud

  • Microsoft
  • more tags...

<< SQL Server: How can I get a distinct count(*) with multiple columns? | Home | Sql Server: How do I get the filegroup, data file name, size and path of a database? >>

SQL Server: Why is it taking so long to take a database offline?

There are probably open sessions on the database you are attempting to bring offline. SQL Server is trying to roll back any existing workloads in-flight for that database. 

Issue the sp_who2 command from a new connection (master db) and view what's active. If you see activity, let it complete--or if you don't want the sessions to complete for whatever reason, issue the kill command for the spid(s).  

In the future, use this command:

ALTER DATABASE yourDBName SET OFFLINE WITH ROLLBACK IMMEDIATE;

To bring the db back online:

ALTER DATABASE yourDBName SET ONLINE

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati
  •   Short Url: http://wblo.gs/11cv
Friday, August 11, 2017 8:21 PM

Feedback

No comments posted yet.


Post A Comment
Title:
Name:
Email:
Comment:
Verification:
 

Copyright © 2007 Informatif. All Rights Reserved. Designed by Free CSS Templates adapted by timheuer.