How to move MSDB (model and master database)

27 Aug

In order to move msdb database in MS SQL 2012, you can do the following:

1: Locate the path to physical files:

SELECT
NAME,
PHYSICAL_NAME AS ‘PhysicalFilePath’,
STATE_DESC AS ‘DB Status’
FROM SYS.MASTER_FILES;

2:  Specify new location for the database

ALTER DATABASE MSDB MODIFY FILE (NAME = MSDBData,FILENAME= ‘C:\SQLDB\Demo\MSDBData.mdf’)
GO
ALTER DATABASE MSDB MODIFY FILE (NAME = MSDBLog,FILENAME= ‘C:\SQLDB\Demo\MSDBLog.ldf’)
GO

3: Stop sql service for the database

4: Move the physical files to new location

5: Start  sql service for the database

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: