none
SQL LocalDb 2012

    Question

  • Hi,

    I think some members here might have considered to move to SQL LocalDB from CE hence the question in this forum.


    Is it possible to install SQL LocalDb 2012 on drive other than C:\ during installation? The GUI does not provide the option but are there any command line options available to install on other drive?

    Follow up: If not possible during installation, is it possible to move system Databases (not user databases) like master, model to a different location?

    For my needs, due to regulations, C:\ drive is protected and cannot write data to C.

    Also, can SQL LocalDB 2012 run in single user mode when restoring Master database is needed?

    Thanks

    Pare

    • Moved by ErikEJMVP Thursday, March 28, 2013 7:20 AM wrong forum
    Wednesday, March 27, 2013 9:19 PM

Answers

  • Hello,

    You can try to change the default path of Database Engine: \Program Files\Microsoft SQL Server\MSSQL11.<InstanceID>.

    After install the instance in default location, we can move the system database to a new location, however the location of the Resource database is <drive>:\Program Files\Microsoft SQL Server\MSSQL11.<instance_name>\MSSQL\Binn\. The database cannot be moved.

    For more information, please see:Move System Databases

    Regards,
    Fanny Liu


    Fanny Liu
    TechNet Community Support

    Thursday, March 28, 2013 11:04 AM

All replies

  •  Hi,

    Is it possible to install SQL LocalDb 2012 on drive other than C:\ during installation? The GUI does not provide the option but are there any command line options available to install on other drive?

    Follow up: If not possible during installation, is it possible to move system Databases like master, model to a different location?

    For my needs, due to regulations, C:\ drive is protected and cannot write data to C.

    Thanks

    Pare

    Tuesday, March 26, 2013 8:29 PM
  • The LocalDB databases are created in the root of the user profile, which is typically on the c: drive.  Take a look at this blog entry which shows how to create DBs on a different drive/path location:

    http://blogs.msdn.com/b/sqlexpress/archive/2011/10/28/localdb-where-is-my-database.aspx

    Ex:

    create database foo on (name='foo', filename='c:\DBs\foo.mdf')

    Thanks,
    Sam Lester (MSFT)

    My Blog

    This posting is provided "AS IS" with no warranties, and confers no rights. Please remember to click "Mark as Answer" and "Vote as Helpful" on posts that help you. This can be beneficial to other community members reading the thread.

    Tuesday, March 26, 2013 8:35 PM
  • Thanks Samuel. I am able to create the user database on different drives. I am looking for moving master, model databases to different drive. Is that possible?

    Thanks

    Tuesday, March 26, 2013 8:46 PM
  • Good question, I didn't know the answer to that one.  They get stored in the AppData folder in the user profiler, but I'm not sure about moving the system DBs after install.  One big difference between LocalDB and Express is that they tried to simplify the installer of LocalDB since LocalDB is intended more developer friendly and a "DBA-less" instance.  The obvious result is the seemingly lack of options for location and other config settings.  Let's see if anyone else jumps into the conversation and has had success moving after install. 

    Thanks,
    Sam Lester (MSFT)


    My Blog

    This posting is provided "AS IS" with no warranties, and confers no rights. Please remember to click "Mark as Answer" and "Vote as Helpful" on posts that help you. This can be beneficial to other community members reading the thread.

    Tuesday, March 26, 2013 9:00 PM
  • I am trying work around solutions as there is no response to this thread. My assumption is that it is not possible to move system databases after the install.

    Is it possible to run localdb in single user environment to restore master database? I have access only to sqlCmd tool and

    I tried following

    "C:\Progran Files\Microsoft SQL Server\110\LoclaDB\Binn\sqlservr.exe" -m

    sqlcmd -S (localdb\v11.0)

    If I run RESTORE master database in the sqlcmd window I get a message stating I am not running in single user mode. Is my syntax/steps incorrect or localdb does not run in single user mode?

    Thanks


    • Edited by Pare.Pare Wednesday, March 27, 2013 6:44 PM
    Wednesday, March 27, 2013 6:43 PM
  • Hello,

    You can try to change the default path of Database Engine: \Program Files\Microsoft SQL Server\MSSQL11.<InstanceID>.

    After install the instance in default location, we can move the system database to a new location, however the location of the Resource database is <drive>:\Program Files\Microsoft SQL Server\MSSQL11.<instance_name>\MSSQL\Binn\. The database cannot be moved.

    For more information, please see:Move System Databases

    Regards,
    Fanny Liu


    Fanny Liu
    TechNet Community Support

    Thursday, March 28, 2013 11:04 AM