Search

Tuesday, June 12, 2012

Moving all SQL Server 2005, SQL Server 2008 or SQL Server 2008R2 System Databases

Once you have reviewed the below KB articles , you can follow these steps to move all system databases at once.

http://msdn.microsoft.com/en-us/library/ms345408(v=SQL.105).aspx
http://support.microsoft.com/kb/224071
  1. Update the -d and -l startup parameters for SQL Server for the new location of the master data and log file
  2. Issue ALTER DATABASE commands to change the file location for the model, msdb and tempdb database files
  3. Stop SQL Server
  4. Move the MDF and LDF files to the new locations specified in steps 1 and 2 for the master, model and msdb databases
  5. Start SQL Server
  6. Delete the old tempdb files
In addition to the master, model, msdb and tempdb databases SQL Server 2005 introduces the mssqlsystemresource database. Microsoft recommends not moving this database, but if you do want to move this database as well you will follow these steps. Note you cannot move the mssqlsystemresource database for SQL Server 2008 or SQL Server 2008R2.
  1. Update the -d and -l registry startup parameters for SQL Server for the new location of the master data and log file
  2. Issue ALTER DATABASE commands to change the file location for the model, msdb and tempdb database files
  3. Stop SQL Server
  4. Move the MDF and LDF files to the new locations specified in steps 1 and 2 for the master, model and msdb databases
  5. Put SQL Server in minimal configuration mode by adding these two startup parameters -f and -T3608 and then start SQL Server
  6. Issue ALTER DATABASE commands for the mssqlsystemresource MDF and LDF files using same path as the master database
  7. Move the MDF and LDF files to the location specified in step 6 for the mssqlsystemresource database
  8. Stop SQL Server
  9. Remove the startup options added in step 5
  10. Start SQL Server
  11. Delete the old tempdb files

Moving all SQL Server 2000 System Databases

Once you have reviewed the KB articles above, you can follow these steps to move all system databases at once.
  1. Update the -d and -l startup parameters for SQL Server for the new location of the master data and log file
  2. Issue ALTER DATABASE commands to change the file location for the tempdb database files
  3. Stop SQL Server
  4. Move the MDF and LDF files to the new location specified in steps 1 for the master database
  5. Put SQL Server in single user mode by adding these three startup parameters -c, -m and -T3608 and then start SQL Server
  6. Detach the msdb and model databases
  7. Move the MDF and LDF files to the new location for the model and msdb databases
  8. Attach the model database from its new location
  9. Stop SQL Server
  10. Remove the startup options added in step 5
  11. Start SQL Server
  12. Attach the msdb database
  13. Delete the old tempdb files

No comments:

Post a Comment