Since msdb is a system databases, we cannot move this just by detach and attach process, as we cannot attach or detach a system database.
- First get the list of msdb files by using this query
select 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 below
Alter Database msdb modify
file (NAME = 'MSDBData' ,FILENAME = 'Drive:\Path\MSDBData.mdf') -- Mention the new location
Alter 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 Location
select name,physical_name from sys.master_files whereDB_NAME(database_id)='msdb'
If the SQL Server Instance is configured with Database Mail option, then after the msdb movement you will have to verify that the database mail is working fine by sending a test email.
No comments:
Post a Comment