Reply to Re: Moving DB from one drive to another

Your name:

Reply:


Posted by Erland Sommarskog on 09/25/07 22:09

Piero 'Giops' Giorgi (giorgi.piero@gmail.com) writes:
> Not anymore... :-)
>
> Is this right? (Files will go in the F:\Main_CrimDB path)
>
> Start with
>
> ALTER DATABASE CrimDB SET OFFLINE
>
> Then move the CrimDB.mdf and CrimDB_log.ldf files to F:\Main_CrimDB
> and F:\Main_CrimDB\Log directories
>
> And then
>
> ALTER DATABASE CrimDB MODIFY FILE ( NAME = CrimDB, FILENAME = 'F:
> \Main_CrimDB\' )
> ALTER DATABASE CrimDB MODIFY FILE ( NAME = CrimDB_Log, FILENAME = 'F:
> \Main_CrimDB\Log' )
>
> ALTER DATABASE CrimDB SET ONLINE
>
> And after that, the script to show the result
>
> SELECT name, physical_name AS CurrentLocation, state_desc
> FROM sys.master_files
> WHERE database_id = DB_ID(N'CrimDB');
>
>
> ... right?

If it's says so in Books Online, I guess it's OK. I haven't this
very often myself.

If you are uncertain of the procedures, create a toy database first
and play with that one.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация