sql2000: MOVING master database files

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

  • 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

  • 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

  • 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

  • Thanks again for your time & expertise. Wishing you a good xmas!

  • 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