Default Directories

  • When you create a database without specifying a location for the DATA and LOG SQL Server places them in the default location (c:\mssql\data).

    Since we have split our DATA and LOG's onto different drives, I was wondering if there is a config parm or reg entry to specify a default directory for DATA and another one for LOG files. I've only found SQLDataRoot and SQLPath, but both of these are set to

    c:\mssql. Is there a way to specify default locations for LOGS and DATA files for a database?

    I'm guessing there is not, so the DBA's will need to remember to specify a location at the time the database is allocated, or move it after creating to get the LOG and DATA to go do separate drives.

    Gregory Larsen, DBA

    If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples

    Gregory A. Larsen, MVP

  • Look at your SQL Server Properties via EM and click on the database settings tab. Towards the bottom you'll see the "Default data directory" and "Default log directory" settings. Make your changes there.

  • To easy. Why was I trying to make this a registry hack.

    Thanks.

    Gregory Larsen, DBA

    If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples

    Gregory A. Larsen, MVP

  • You can establish default folder locations for both data and log files through EM - select server properties and click on the "Database Properties" tab.

    Steve Armistead,

    Database Administration

    Panther Systems Northwest, Inc.

    Vancouver, WA

    Steve

  • I ran a trace when changing the default data file location in EM and saw the following query result:

    xp_instance_regwrite N'HKEY_LOCAL_MACHINE',N'Software\Microsoft\MSSQLServer\MSSQLServer',N'DefaultData',REG_SZ,N'C:\MSSQL\Data\'

    Steve Armistead,

    Database Administration

    Panther Systems Northwest, Inc.

    Vancouver, WA

    Steve

  • Thank you for the tips. Turns out the "DefaultData" and "DefaultLog" entries only exist after you have initial set the default directories to something. If you have not set these these reg entries do not exist. It is great to know I could change these is more than one place.

    Thanks a bunch.

    Gregory Larsen, DBA

    If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples

    Gregory A. Larsen, MVP

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply