December 12, 2001 at 5:43 am
I have a disk which has shown signs of becoming unstable. I wish to move the master database MDF & LDF files to another disk.
How do I do this? (restore with move not allowed when sql server in single-user mode)
appreciate any input here..
December 12, 2001 at 7:01 am
Not too sure if it is the same in SQL2000, but in SQL 7 the following moves master:
Take a backup first!
right click the SQL server in Enterprise manager and click Properties
Click on Startup Parameters
remove the entries for -d, -l and -e and replace with new values. -d is the file name of the mdf, including full path. -l is the file name of the ldf, including full path. -e is the file name of the error log, including full path
eg
-dE:\Data\master.mdf
-lF:\Data\master.ldf
-eE:\Data\Log\ERRORLOG
Double check the values you put in here, otherwise SQL Server may not restart properly.
Come out of EM.
Stop SQL Server via Control Panel, Services
copy mater.mdf and master.ldf to new locations
Restart SQL Server via Control Panel, Services
Hope this is of some help
Petra
December 12, 2001 at 7:30 am
Thanks Petra. Does exactly the job for the master db. How does one move the MODEL db?
The BOL is very unclear on this.
Edited by - hanscza on 12/13/2001 12:57:30 AM
December 13, 2001 at 2:19 am
To move model do the following
right click the SQL Server in EM and click properties
click on startup parameters
add new parameter -T3608
Stop SQL Server via control panel, Services
Restart SQL Server via control panel, services
in Query Analyzer
use master
go
sp_detach_db 'model'
go
Then copy model.mdf to new location
copy model.ldf to new location
in Query analyzer
use master
go
sp_attach_db 'model', 'new location of mdf', 'new location of ldf'
go
(eg sp_attach_db 'model', 'd:\Data\model.mdf',
'E:\Data\Log\modellog.ldf')
right click the SQL Server in EM and click properties
click on startup parameters
remove parameter -T3608
Stop SQL Server via control panel, services
Restart SQL Server via control panel, services
At least that's how you do it in SQL Server 7. Hope it helps!
Edited by - pglover on 12/13/2001 02:19:22 AM
December 13, 2001 at 2:31 am
Thanks again for your time & expertise. Wishing you a good xmas!
December 13, 2001 at 2:59 am
Hope you have a good christmas too!
I have found this site to be excellent for getting help when you don't know what you are doing and can't find help in bol!
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply