![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Question is: How can I move the DB to another drive, leaving the filegroups where they are? |
|
Hi! I'm using SQL Server 2005. The DB has one table partitioned on 50 Filegroups (One per state) The DB is right now on my drive G: as are the filegroups (But in separate directories), and for a number of reasons, I have to move the DB to drive F: but I need to keep the filegroups (With the bulk of the data) on drive G: Question is: How can I move the DB to another drive, leaving the filegroups where they are? Thank you!!! P |
#3
| |||
| |||
|
|
I'm using SQL Server 2005. The DB has one table partitioned on 50 Filegroups (One per state) The DB is right now on my drive G: as are the filegroups (But in separate directories), and for a number of reasons, I have to move the DB to drive F: but I need to keep the filegroups (With the bulk of the data) on drive G: Question is: How can I move the DB to another drive, leaving the filegroups where they are? |
#4
| |||
| |||
|
|
Question is: How can I move the DB to another drive, leaving the filegroups where they are? 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 |
#5
| |||
| |||
|
|
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 |
#6
| |||
| |||
|
|
On Sep 25, 12:59 am, Erland Sommarskog <esq... (AT) sommarskog (DOT) 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 |
|
The Filegroups will be seen without any other change, right? |
#7
| |||
| |||
|
|
In the copy of Books Online I have it suggests ALTER DATABASE SET OFFLINE. Does it really say sp_detach_db in yours? |
#8
| |||
| |||
|
|
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? |
#9
| |||
| |||
|
|
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. |
#10
| |||
| |||
|
|
If it's says so in Books Online, I guess it's OK. I haven't this very often myself. |
![]() |
| Thread Tools | |
| Display Modes | |
| |