Moving the Master Database Lesson Learned

 With the new 2008R2 servers that were recently built, I am hoping to institute some standard best practices on the boxes moving forward.  The first one was to move the TempDB to its own drive on a separate LUN and since I have moved a TempDB before, no problems here.  The second best practice was to make a separate drive on a separate LUN for the databases and log files, check and check.  The third practice was to move the system databases, which sounded simple in theory but I have never done it before, uncheck–it did not work.

I followed Microsoft’s directions but it did not cover my contingency.  The following excerpt is taken from Microsoft’s MSDN site for SQL Server 2008 R2 in order to Move the Master Database, with changes for my separate drives.  

To move the master database, follow these steps.

  1. From the Start menu, point to All Programs, point to Microsoft SQL Server, point to Configuration Tools, and then click SQL Server Configuration Manager.
  2. In the SQL Server Services node, right-click the instance of SQL Server (for example, SQL Server (MSSQLSERVER)) and choose Properties.
  3. In the SQL Server (instance_name) Properties dialog box, click the Advanced tab.
  4. Edit the Startup Parameters values to point to the planned location for the master database data and log files, and click OK. Moving the error log file is optional.The parameter value for the data file must follow the -d parameter and the value for the log file must follow the -l parameter. The following example shows the parameter values for the default location of the master data and log files.
    -J:\SQL\master.mdf;-eC:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\
  5. Stop the instance of SQL Server by right-clicking the instance name and choosing Stop.
  6. Move the master.mdf and mastlog.ldf files to the new location.
  7. Restart the instance of SQL Server. Here is where I had my issue, it would not restart.  Through my troubleshooting I realized that the new folder did not have the same permissions as the original folder.   I added the SQLServerMSSQLUser$<machine name>$<instance name> user that was created by the SQL installer.  Problem solved.
  8. Verify the file change for the master database by running the following query.
    SELECT name, physical_name AS CurrentLocation, state_desc
    FROM sys.master_files
    WHERE database_id = DB_ID(‘master’);

MasterDB Results of New Location

Verify the file change

MasterDB Properties

Enjoy!  I hope this helps!

About SQLGator

Florida Gator and Certified SQL Server Enthusiast, Star Wars fanatic and is there anything else...oh yeah PS3! I am a geek and SQL Server DBA who dabbles with VMWare, there are other technologies greater than these? Not so fast my friend! I also love to travel to new and exotic places.

Posted on December 6, 2011, in Installation, Lessons Learned and tagged , , , , . Bookmark the permalink. 9 Comments.

  1. Thanks for any other great article. The place else could anyone
    get that type of info in such a perfect manner of
    writing? I’ve a presentation subsequent week, and I am
    at the look for such information.

  2. Actually when someone doesn’t be aware of afterward its up
    to other viewers that they will help, so here it

  3. The giant toys marching across the stage will delight your children, while grownups are charmed by the Dance
    of the Snowflakes and other well-loved scenes. Civic night clubs are usually an ideal spot to be lent or perhaps hire a dress-up costume for any day.
    But from the 3 Wise Men who brought gifts for baby Jesus.

  4. Hi, this weekend is nice designed for me, as this point in time i am reading this enormous educational post here at my

  5. Good information. Lucky me I recently found your website
    by accident (stumbleupon). I have saved it for later!

  6. Makes 4 servings. North American farmers have been unable to
    match the quality of the quinoa grown in the Andean countries although more and more of them are cultivating it these days.
    Quinoa is a complete vegetable food protein.

  7. If readers appear on your blog, then navigate away immediately,
    this is referred to as a ‘bounce’, and high bounce
    rates lower your position in search engines. For gathering more info about a great company which offers mobile development in Massachusetts and also about SEO Massachusetts services, please check out
    these links. It can be either the standard internet searcher or online
    networking system.

  8. It will help you immediately ascertain if there are issues that need
    to be addressed without further delay. In the process of planning a large project, one can encounter situations where walls are removed or
    modified, roofs are extended and other issues beyond the experience of a home owner are encountered.
    Follow Floyd Medical Center on Facebook, CLICK HERE.

  1. Pingback: What is a Blocked Process, and Why Do I Care? « SQL Swampland

Leave a Reply

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

You are commenting using your 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


Get every new post delivered to your Inbox.

Join 2,020 other followers

%d bloggers like this: