码迷,mamicode.com
首页 > 数据库 > 详细

Move System Databases in MS SQL SERVER

时间:2015-07-12 14:02:29      阅读:174      评论:0      收藏:0      [点我收藏+]

标签:

--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‘);

Move System Databases in MS SQL SERVER

标签:

原文地址:http://www.cnblogs.com/matong/p/4640806.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!