標籤:
--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 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