You are here: Re: Moving DB from one drive to another « MsSQL Server « IT news, forums, messages
Re: Moving DB from one drive to another

Posted by Piero 'Giops' Giorgi on 09/25/07 21:34

On Sep 25, 1:50 pm, Erland Sommarskog <esq...@sommarskog.se> wrote:

> In the copy of Books Online I have it suggests ALTER DATABASE SET OFFLINE.
> Does it really say sp_detach_db in yours?

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?

P

 

Navigation:

[Reply to this 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

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