Sunday, February 19, 2012

Attaching-detaching Db = Too long

Why does it take time to detach or attach a Db sometimes ?Karolyn,

It shouldn't. It's the fastest method.

The file shoud however be on the local machine, not acorss the network..

How big are we talking?|||It could be the database is going into recovery. Anything showing up in the SQL Errorlog?|||when detaching a database sqlserver checks if there are changes suchs as updates and inserts that were processed but has not (yet) actually done. The changes reside in memory of sqlserver but were not written to the disk. So I think it does these first prior detaching.|||Detaching can take a while, because of the need to "flush the log", etc. It seems to me that the GUI provides a checkbox to skip that step, but that is needless risk from my perspective.

I can't think of a reason that attaching a database would take more than a minute or so (basically modify a few system tables, then go through the normal database recovery/startup that happens whenever a database is first opened).

-PatP

No comments:

Post a Comment