O'Reilly logo

Microsoft® SQL Server® 2008 Step by Step by Mike Hotek

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Moving Databases

At times, you may need to move databases around within your environment to take advantage of additional storage space or machines with higher processing capacity. Since SQL Server will start up each database within an instance and open every associated file for read/write operations, you need to perform several steps to be able to move a database.

The first step in the process, detach, removes the database entry from the instance, closes all files associated to the database, and releases all operating system locks. The final step in the process, attach, creates a new database entry within the instance and opens all files associated to the database.

Note

If you need to move files to different directories on the same server, then you ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required