Moving model database:
- First get the list of model database files by using this queryselect name,physical_name from sys.master_files whereDB_NAME(database_id)='model'
- Then for each model database file that you need to move, execute statements like belowAlter Database model modifyfile (NAME = 'modeldev' ,FILENAME = 'Drive:\Path\model.mdf') -- Mention the new locationAlter Database model modifyfile (NAME = 'modellog' ,FILENAME = 'Drive:\Path\modellog.ldf') -- Mention the new location
- Stop SQL Services
- Move the files manually to the new location
- Start SQL Services
- Verify the new Locationselect name,physical_name from sys.master_files whereDB_NAME(database_id)='model'
Moving msdb database:
- First get the list of msdb files by using this queryselect name,physical_name from sys.master_files whereDB_NAME(database_id)='msdb'
- Then for each msdb database file that you need to move, execute statements like belowAlter Database msdb modifyfile (NAME = 'MSDBData' ,FILENAME = 'Drive:\Path\MSDBData.mdf') -- Mention the new locationAlter Database msdb modifyfile (NAME = 'MSDBLog' ,FILENAME = 'Drive:\Path\MSDBLog.ldf') -- Mention the new location
- Stop SQL Services
- Move the files manually to the new location
- Start SQL Services
- Verify the new Locationselect name,physical_name from sys.master_files whereDB_NAME(database_id)='msdb'
No comments:
Post a Comment