April 11, 2006 at 8:42 pm
SQL Server Databases present on different servers are present on SAN storage drives. I don't know much about storage drives, but there are some 10 drives on my server(C:drive to N: drive) .Data files(.mdf) are stored on J: drive and I want to move some data files on to other drive(M:drive).
Can we do sp_detach and sp_attach of these files or is there any other procedure? Is there any other method for SAN storage?
April 11, 2006 at 11:37 pm
Just make sure that no one else is using the database. After which you can use the sp_detach_db and sp_attach_db after the relevant files are moved to their new location.
April 12, 2006 at 2:04 am
If you're moving several databases make sure you attach in the correct order to maintain the database id's.
[font="Comic Sans MS"]The GrumpyOldDBA[/font]
www.grumpyolddba.co.uk
http://sqlblogcasts.com/blogs/grumpyolddba/
April 12, 2006 at 5:13 am
I just want to move only one database from that drive to other. other databases will be on the same drive.
Can I put the database in single user mode?
April 12, 2006 at 11:15 am
April 12, 2006 at 12:27 pm
Detach- Move mdf and ldf files- Attach
April 13, 2006 at 9:57 am
--> If you're moving several databases make sure you attach in the correct order to maintain the database id's.
I didnot get that. Like..
If I am moving DB1(DB1.mdf, DB1.log)
DB2(DB2.mdf, DB2_data.ndf, DB2.log)
DB3(DB3.mdf, DB3.log)
If I am moving DB1.mdf from drive D: to driveE: , DB1.log to drive F: and DB2.mdf and DB2.ndf from drive D: to Drive G: etc..
How can I maintain the database ID's?
April 13, 2006 at 12:48 pm
Use the below statement from the master db. Hope this helps !
use master
select * from sysdatabases order by dbid
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply