| title | File Locations for Default and Named Instances of SQL Server | Microsoft Docs |
|---|---|
| ms.custom | |
| ms.date | 08/25/2017 |
| ms.prod | sql |
| ms.reviewer | |
| ms.technology | install |
| ms.topic | conceptual |
| ms.assetid | 463c570e-9f75-4653-b3b8-4d61753b0013 |
| author | MashaMSFT |
| ms.author | mathoma |
[!INCLUDEappliesto-ss-xxxx-xxxx-xxx-md-winonly]
An installation of [!INCLUDEssNoVersion] consists of one or more separate instances. An instance, whether default or named, has its own set of program and data files, as well as a set of common files shared between all instances of [!INCLUDEssNoVersion] on the computer.
For an instance of [!INCLUDEssNoVersion] that includes the [!INCLUDEssDE], [!INCLUDEssASnoversion], and [!INCLUDEssRSnoversion], each component has a full set of data and executable files, and common files shared by all components.
To isolate install locations for each component, unique instance IDs are generated for each component within a given instance of [!INCLUDEssNoVersion].
Important
Program files and data files cannot be installed on a removable disk drive, cannot be installed on a file system that uses compression, cannot be installed to a directory where system files are located, and cannot be installed on shared drives on a failover cluster instance.
You might need to configure scanning software, such as antivirus and antispyware applications, to exclude SQL Server folders and file types. Review this support article for more information: Antivirus software on computers running SQL Server.
System databases (master, model, MSDB, and tempdb), and [!INCLUDEssDE] user databases can be installed with Server Message Block (SMB) file server as a storage option. This applies to both [!INCLUDEssNoVersion] stand-alone and [!INCLUDEssNoVersion] failover cluster installations (FCI). For more information, see Install SQL Server with SMB Fileshare as a Storage Option.
Do not delete any of the following directories or their contents: Binn, Data, Ftdata, HTML, or 1033. You can delete other directories, if necessary; however, you might not be able to retrieve any lost functionality or data without uninstalling and then reinstalling [!INCLUDEssNoVersion]. Do not delete or modify any of the .htm files in the HTML directory. They are required for [!INCLUDEssNoVersion] tools to function properly.
Shared Files for All Instances of [!INCLUDEssNoVersion]
Common files used by all instances on a single computer are installed in the folder [!INCLUDEssInstallPathVar]. <drive> is the drive letter where components are installed. The default is usually drive C. <nnn> identifies the version. The following table identifies versions for the paths.
| <nnn> | Version |
|---|---|
| 140 | [!INCLUDEssqlv14] |
| 130 | [!INCLUDEssqlv13] |
| 120 | SQL Server 2014 |
| 110 | [!INCLUDEsssql11] |
During [!INCLUDEssNoVersion] Setup, an instance ID is generated for each server component. The server components in this [!INCLUDEssNoVersion] release are the [!INCLUDEssDE], [!INCLUDEssASnoversion], and [!INCLUDEssRSnoversion].
The default instance ID is constructed by using the following format:
-
MSSQL for the [!INCLUDEssDE], followed by the major version number, followed by an underscore and the minor version when applicable, and a period, followed by the instance name.
-
MSAS for [!INCLUDEssASnoversion], followed by the major version number, followed by an underscore and the minor version when applicable, and a period, followed by the instance name.
-
MSRS for [!INCLUDEssRSnoversion], followed by the major version number, followed by an underscore and the minor version when applicable, and a period, followed by the instance name.
Examples of default instance IDs in this release of [!INCLUDEssNoVersion] are as follows:
-
MSSQL14.MSSQLSERVER for a default instance of [!INCLUDEssCurrent].
-
MSAS14.MSSQLSERVER for a default instance of [!INCLUDEssASCurrent].
-
MSSQL14.MyInstance for a named instance of [!INCLUDEssCurrent] named "MyInstance."
[!NOTE] The two digit number in the instance ID path identifies the version number. In the preceding examples, version number 14 is [!INCLUDEssqlv14].
The directory structure for a [!INCLUDEssCurrent] named instance that includes the [!INCLUDEssDE] and [!INCLUDEssASnoversion], named "MyInstance", and installed to the default directories would be as follows:
-
C:\Program Files\Microsoft SQL Server\MSSQL14.MyInstance\
-
C:\Program Files\Microsoft SQL Server\MSAS14.MyInstance\
You can specify any value for the instance ID, but avoid special characters and reserved keywords.
You can specify a non-default instance ID during [!INCLUDEssNoVersion] Setup. Instead of <Program Files>\[!INCLUDEmsCoName][!INCLUDEssNoVersion], a <custom path>\[!INCLUDEmsCoName][!INCLUDEssNoVersion] is used if the user chooses to change the default installation directory. Note that instance IDs that begin with an underscore (_) or that contain the number sign (#) or the dollar sign ($) are not supported.
Note
[!INCLUDEssISnoversion] and client components are not instance aware and, therefore are not assigned an instance ID. By default, non-instance-aware components are installed to a single directory: [!INCLUDEssInstallPathVar]. Changing the installation path for one shared component also changes it for the other shared components. Subsequent installations install non-instance-aware components to the same directory as the original installation.
[!INCLUDEssNoVersion] [!INCLUDEssASnoversion] is the only [!INCLUDEssNoVersion] component that supports instance renaming after installation. If an instance of [!INCLUDEssASnoversion] is renamed, the instance ID will not change. After instance renaming is complete, directories and registry keys will continue to use the instance ID created during installation.
The registry hive is created under HKLM\Software\[!INCLUDEmsCoName]\[!INCLUDEmsCoName][!INCLUDEssNoVersion]\<Instance_ID> for instance-aware components. For example,
-
HKLM\Software\[!INCLUDEmsCoName]\[!INCLUDEmsCoName][!INCLUDEssNoVersion]\MSSQL14.MyInstance
-
HKLM\Software\[!INCLUDEmsCoName]\[!INCLUDEmsCoName][!INCLUDEssNoVersion]\MSAS14.MyInstance
-
HKLM\Software\[!INCLUDEmsCoName]\[!INCLUDEmsCoName][!INCLUDEssNoVersion]\MSRS14.MyInstance
The registry also maintains a mapping of instance ID to instance name. Instance ID to instance name mapping is maintained as follows:
-
[HKEY_LOCAL_MACHINE\Software\[!INCLUDEmsCoName]\[!INCLUDEmsCoName][!INCLUDEssNoVersion]\Instance Names\SQL] "InstanceName"="MSSQL14"
-
[HKEY_LOCAL_MACHINE\Software\[!INCLUDEmsCoName]\[!INCLUDEmsCoName][!INCLUDEssNoVersion]\Instance Names\OLAP] "InstanceName"="MSAS14"
-
[HKEY_LOCAL_MACHINE\Software\[!INCLUDEmsCoName]\[!INCLUDEmsCoName][!INCLUDEssNoVersion]\Instance Names\RS] "InstanceName"="MSRS14"
During Setup, you can change the installation path for the following features:
The installation path is displayed in Setup only for features with a user-configurable destination folder:
| Component | Default path | Configurable or Fixed Path |
|---|---|---|
| [!INCLUDEssDE] server components | \Program Files\[!INCLUDEmsCoName][!INCLUDEssNoVersion]\MSSQL14.<InstanceID>\ | Configurable |
| [!INCLUDEssDE] data files | \Program Files\[!INCLUDEmsCoName][!INCLUDEssNoVersion]\MSSQL14.<InstanceID>\ | Configurable |
| [!INCLUDEssASnoversion] server | \Program Files\[!INCLUDEmsCoName][!INCLUDEssNoVersion]\MSAS14.<InstanceID>\ | Configurable |
| [!INCLUDEssASnoversion] data files | \Program Files\[!INCLUDEmsCoName][!INCLUDEssNoVersion]\MSAS14.<InstanceID>\ | Configurable |
| [!INCLUDEssRSnoversion] report server | \Program Files\[!INCLUDEmsCoName][!INCLUDEssNoVersion]\MSRS14.<InstanceID>\Reporting Services\ReportServer\Bin\ | Configurable |
| [!INCLUDEssRSnoversion] report manager | \Program Files\[!INCLUDEmsCoName][!INCLUDEssNoVersion]\MSRS14.<InstanceID>\Reporting Services\ReportManager\ | Fixed path |
| [!INCLUDEssISnoversion] | <Install Directory>\140\DTS\ 1 | Configurable |
| Client Components (except bcp.exe and sqlcmd.exe) | <Install Directory>\140\Tools\ 1 | Configurable |
| Client Components (bcp.exe and sqlcmd.exe) | <Install Directory>\Client SDK\ODBC\110\Tools\Binn | Fixed path |
| Replication and server-side COM objects | [!INCLUDEssInstallPathVar]COM\ 2 | Fixed path |
| [!INCLUDEssISnoversion] component DLLs for the Data Transformation Run-time engine, the Data Transformation Pipeline engine, and the dtexec command prompt utility | [!INCLUDEssInstallPathVar]DTS\Binn | Fixed path |
| DLLs that provide managed connection support for [!INCLUDEssISnoversion] | [!INCLUDEssInstallPathVar]DTS\Connections | Fixed path |
| DLLs for each type of enumerator that [!INCLUDEssISnoversion] supports | [!INCLUDEssInstallPathVar]DTS\ForEachEnumerators | Fixed path |
| [!INCLUDEssNoVersion] Browser Service, WMI providers | [!INCLUDEssInstallPathVar]Shared\ | Fixed path |
| Components that are shared between all instances of [!INCLUDEssNoVersion] | [!INCLUDEssInstallPathVar]Shared\ | Fixed path |
Warning
Ensure that the \Program Files\[!INCLUDEmsCoName][!INCLUDEssNoVersion]\ folder is protected with limited permissions.
Note that the default drive for file locations is systemdrive, normally drive C. Installation paths for child features are determined by the installation path of the parent feature.
1 A single installation path is shared between [!INCLUDEssISnoversion] and client components. Changing the installation path for one component also changes it for other components. Subsequent installations install components to the same location as the original installation.
2 This directory is used by all instances of [!INCLUDEssNoVersion] on a computer. If you apply an update to any of the instances on the computer, any changes to files in this folder will affect all instances on the computer. When you add features to an existing installation, you cannot change the location of a previously installed feature, nor can you specify the location for a new feature. You must either install additional features to the directories already established by Setup, or uninstall and reinstall the product.
Note
For clustered configurations, you must select a local drive that is available on every node of the cluster.
When you specify an installation path during Setup for the server components or data files, the Setup program uses the instance ID in addition to the specified location for program and data files. Setup does not use the instance ID for tools and other shared files. Setup also does not use any instance ID for the [!INCLUDEssASnoversion] program and data files, although it does use the instance ID for the [!INCLUDEssASnoversion] repository.
If you set an installation path for the [!INCLUDEssDE] feature, [!INCLUDEssNoVersion] Setup uses that path as the root directory for all instance-specific folders for that installation, including SQL Data Files. In this case, if you set the root to "C:\Program Files\[!INCLUDEmsCoName][!INCLUDEssNoVersion]\MSSQL14.<InstanceName>\MSSQL\", instance-specific directories are added to the end of that path.
Customers who choose to use the USESYSDB upgrade functionality in the [!INCLUDEssNoVersion] Installation Wizard (Setup UI mode) can easily lead themselves into a situation where the product gets installed into a recursive folder structure. For example, <SQLProgramFiles>\MSSQL14\MSSQL\MSSQL10_50\MSSQL\Data\. Instead, to use the USESYSDB feature, set an installation path for the SQL Data Files feature instead of the [!INCLUDEssDE] feature.
Note
Data files are always expected to be found in a child directory named Data. For example, specify C:\Program Files\[!INCLUDEmsCoName][!INCLUDEssNoVersion]\MSSQL14.<InstanceName>\ to specify the root path to the data directory of the system databases during upgrade when data files are found under C:\Program Files\[!INCLUDEmsCoName][!INCLUDEssNoVersion]\MSSQL14.<InstanceName>\MSSQL\Data.
Database Engine Configuration - Data Directories
Analysis Services Configuration - Data Directories