Reply to Re: Moving DB from one drive to another

Your name:

Reply:


Posted by Erland Sommarskog on 09/25/07 20:50

Piero 'Giops' Giorgi (giorgi.piero@gmail.com) writes:
> On Sep 25, 12:59 am, Erland Sommarskog <esq...@sommarskog.se> wrote:
>
>> This link in Books Online should be useful:
>> ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/ad9a4e92-13fb-457d-996a-
66ffc2d55b79.htm
>
> ... Am I right? (Just to be sure...)
>
> The files NOW are in G:\CrimDB\ and I need them in F:\CrimDB\
> The Filegroups are in G:\CrimDB\FileGroups
>
> Basically I have to :
>
> 1) Detach the Database

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

This may be possible if you have an old version. I see now that the page
was updated on 5 December 2005, and the Change History says "Corrected the
steps in all procedures.".

See my signature for a link do download the updated Books Online.

Here is what my Books Online says:

To move a data or log file as part of a planned relocation, follow these
steps:

Run the following statement.

ALTER DATABASE database_name SET OFFLINE

Move the file or files to the new location.

For each file moved, run the following statement.

ALTER DATABASE database_name MODIFY FILE
( NAME = logical_name, FILENAME = 'new_path\os_file_name' )

Run the following statement.

ALTER DATABASE database_name SET ONLINE

Verify the file change by running the following query.

SELECT name, physical_name AS CurrentLocation, state_desc
FROM sys.master_files
WHERE database_id = DB_ID(N'<database_name>');

> The Filegroups will be seen without any other change, right?

I don't know, and I don't have a multi-filegroup database to try on.

In any case, what I had in mind was ALTER DATABASE SET OFFLINE. Since
I did not remember the procedures exactly, I found link and posted
that. Sorry if that lead you to an old version that was incorrect.

--
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

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