Move System Databases in MS SQL SERVER

--Move tempdb
ALTER DATABASE tempdb MODIFY FILE(NAME='tempdev',FILENAME='D:\Database\tempdb.mdf');
ALTER DATABASE tempdb MODIFY FILE(NAME = 'templog',FILENAME='F:\Logs\templog.ldf');

--Move model
ALTER DATABASE model MODIFY FILE(NAME='modeldev',FILENAME='F:\SYSTEM_DB\model.mdf');
ALTER DATABASE model MODIFY FILE(NAME='modellog',FILENAME='F:\SYSTEM_DB\modellog.ldf');
--Move msdb
ALTER DATABASE msdb MODIFY FILE(NAME='MSDBData',FILENAME='F:\SYSTEM_DB\msdbdata.mdf');
ALTER DATABASE msdb MODIFY FILE(NAME='MSDBLog',FILENAME='F:\SYSTEM_DB\msdb_log.ldf');

  move master use url: https://technet.microsoft.com/en-us/library/ms345408(v=sql.110).aspx#master

--Move tempdbALTER DATABASE tempdb MODIFY FILE(NAME='tempdev',FILENAME='D:\Database\tempdb.mdf');ALTER DATABASE tempdb MODIFY FILE(NAME = 'templog',FILENAME='F:\Logs\templog.ldf');
--Move modelALTER DATABASE model MODIFY FILE(NAME='modeldev',FILENAME='F:\SYSTEM_DB\model.mdf');ALTER DATABASE model MODIFY FILE(NAME='modellog',FILENAME='F:\SYSTEM_DB\modellog.ldf');--Move msdbALTER DATABASE msdb MODIFY FILE(NAME='MSDBData',FILENAME='F:\SYSTEM_DB\msdbdata.mdf');ALTER DATABASE msdb MODIFY FILE(NAME='MSDBLog',FILENAME='F:\SYSTEM_DB\msdb_log.ldf');

posted @ 2015-07-12 12:47  黄铨  阅读(264)  评论(0编辑  收藏  举报